]> git.baikalelectronics.ru Git - kernel.git/commit
HID: elo: Revert USB reference counting
authorJiri Kosina <jkosina@suse.cz>
Thu, 17 Feb 2022 13:13:49 +0000 (14:13 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 17 Feb 2022 13:14:41 +0000 (14:14 +0100)
commitf655539b7d8fbe5c2444d77d31755afb8d4d0330
tree845a24931d6171f555e5d3b8ae7076643cb8efdd
parentce9bc1b9d4f39ff5312efbde5d22dba4ab2d80b3
HID: elo: Revert USB reference counting

Commit 0b0576403bc ("HID: elo: fix memory leak in elo_probe") introduced
memory leak on error path, but more importantly the whole USB reference
counting is not needed at all in the first place, as the driver itself
doesn't change the reference counting in any way, and the associated
usb_device is guaranteed to be kept around by USB core as long as the
driver binding exists.

Reported-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: d9075cbee78 ("HID: elo: update the reference count of the usb device structure")
Fixes: 0b0576403bc ("HID: elo: fix memory leak in elo_probe")
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-elo.c