LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] HID: wacom: Release device resource data obtained by devres_alloc()
@ 2018-04-24  8:03 Arvind Yadav
  2018-04-24  9:04 ` Benjamin Tissoires
  2018-04-25  8:51 ` Jiri Kosina
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2018-04-24  8:03 UTC (permalink / raw)
  To: jikos, benjamin.tissoires, jkosina; +Cc: linux-kernel, linux-input

Free device resource data, if __wacom_devm_sysfs_create_group
is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/hid/wacom_sys.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index b54ef1f..ee7a37e 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1213,8 +1213,10 @@ static int __wacom_devm_sysfs_create_group(struct wacom *wacom,
 	devres->root = root;
 
 	error = sysfs_create_group(devres->root, group);
-	if (error)
+	if (error) {
+		devres_free(devres);
 		return error;
+	}
 
 	devres_add(&wacom->hdev->dev, devres);
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-25  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24  8:03 [PATCH] HID: wacom: Release device resource data obtained by devres_alloc() Arvind Yadav
2018-04-24  9:04 ` Benjamin Tissoires
2018-04-25  8:51 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).