Skip to content

Commit 817b8b9

Browse files
mudongliangJiri Kosina
authored andcommitted
HID: elo: fix memory leak in elo_probe
When hid_parse() in elo_probe() fails, it forgets to call usb_put_dev to decrease the refcount. Fix this by adding usb_put_dev() in the error handling code of elo_probe(). Fixes: fbf4272 ("HID: elo: update the reference count of the usb device structure") Reported-by: syzkaller <syzkaller@googlegroups.com> Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent e26a780 commit 817b8b9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/hid/hid-elo.c

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

263263
return 0;
264264
err_free:
265+
usb_put_dev(udev);
265266
kfree(priv);
266267
return ret;
267268
}

0 commit comments

Comments
 (0)