OSDN Git Service
(root)
/
uclinux-h8
/
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
43b1c72
..
9bc6f48
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: