Skip to content

Commit e4cf19f

Browse files
bentissJiri Kosina
authored andcommitted
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 844817e commit e4cf19f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/hid/hid-thingm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ static int thingm_probe(struct hid_device *hdev, const struct hid_device_id *id)
250250

251251
if (!tdev->fwinfo) {
252252
hid_err(hdev, "unsupported firmware %c\n", tdev->version.major);
253+
err = -ENODEV;
253254
goto stop;
254255
}
255256

0 commit comments

Comments
 (0)