]> git.baikalelectronics.ru Git - kernel.git/commit
HID: elo: fix memory leak in elo_probe
authorDongliang Mu <mudongliangabcd@gmail.com>
Sat, 22 Jan 2022 09:48:26 +0000 (17:48 +0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 24 Jan 2022 08:03:21 +0000 (09:03 +0100)
commite83e954f8d8493e9c9df981657eb14f74c75e548
tree7ef55414bc457869230f3304dd049eacb0133ad1
parent56efcb4a49bd4ef701610f52ee32fc12a1c9684b
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: 73e7a53a7b6e ("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>
drivers/hid/hid-elo.c