HID: elo: Revert USB reference counting
authorJiri Kosina <jkosina@suse.cz>
Thu, 17 Feb 2022 13:13:49 +0000 (14:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Mar 2022 13:23:35 +0000 (14:23 +0100)
commita5334502f91fe68b7edee502af20b292ad42259a
tree862d2e452e553403f759f77c3b41ea28d7394a54
parentaf4fcf85c88da357be7238dbeb5f7ae901c235e3
HID: elo: Revert USB reference counting

[ Upstream commit ac89895213d8950dba6ab342863a0959f73142a7 ]

Commit 817b8b9c539 ("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: fbf42729d0e ("HID: elo: update the reference count of the usb device structure")
Fixes: 817b8b9c539 ("HID: elo: fix memory leak in elo_probe")
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-elo.c