projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fdea70d
)
HID: hid-ntrig: add error handling for sysfs_create_group
author
Zhouyang Jia
<jiazhouyang09@gmail.com>
Thu, 14 Jun 2018 13:37:17 +0000
(21:37 +0800)
committer
Jiri Kosina
<jkosina@suse.cz>
Mon, 25 Jun 2018 13:16:11 +0000
(15:16 +0200)
When sysfs_create_group fails, the lack of error-handling code may
cause unexpected results.
This patch adds error-handling code after calling sysfs_create_group.
Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-ntrig.c
patch
|
blob
|
history
diff --git
a/drivers/hid/hid-ntrig.c
b/drivers/hid/hid-ntrig.c
index 43b1c72343162ea09e4ed5bbe99581fc826565be..9bc6f4867cb3b82e0b0eb9202ce6b20b4eb548a7 100644
(file)
--- a/
drivers/hid/hid-ntrig.c
+++ b/
drivers/hid/hid-ntrig.c
@@
-955,6
+955,8
@@
static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
ret = sysfs_create_group(&hdev->dev.kobj,
&ntrig_attribute_group);
+ if (ret)
+ hid_err(hdev, "cannot create sysfs group\n");
return 0;
err_free: