summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-09-02 19:50:43 (GMT)
committerJiri Kosina <jkosina@suse.cz>2014-09-03 21:46:09 (GMT)
commite4cf19ffe060e75d34c007565d0aef7189ec654e (patch)
treec18319e8e323b883689c68711674a1de828ee233 /drivers/hid
parent844817e47eef14141cf59b8d5ac08dd11c0a9189 (diff)
downloadlinux-e4cf19ffe060e75d34c007565d0aef7189ec654e.tar.xz
HID: thingm: set the proper error code before leaving
In case of an unsupported firmware, the driver bails out without setting the LEDs interfaces, but forget to set the proper error code. err is then still equal to 0 and the hid subsytem consider the device to be in perfect shape. When removing it, thingm_remove() tries to unbind the rgb LEDs which has not been created, leading to a segfault. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-thingm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hid/hid-thingm.c b/drivers/hid/hid-thingm.c
index 134be89..f91f971 100644
--- a/drivers/hid/hid-thingm.c
+++ b/drivers/hid/hid-thingm.c
@@ -250,6 +250,7 @@ static int thingm_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (!tdev->fwinfo) {
hid_err(hdev, "unsupported firmware %c\n", tdev->version.major);
+ err = -ENODEV;
goto stop;
}