Re: [PATCH] HID: elo: Fix refcount leak in elo_probe()
From: Jiri Kosina <jikos@kernel.org>
Date: 2022-02-17 13:21:11
Also in:
linux-usb
From: Jiri Kosina <jikos@kernel.org>
Date: 2022-02-17 13:21:11
Also in:
linux-usb
On Thu, 17 Feb 2022, Dan Carpenter wrote:
quoted
The refcount was added less than a year ago by Salah Triki in commit fbf42729d0e9 ("HID: elo: update the reference count of the usb device structure"), but the commit message doesn't explain why it is necessary. There certainly isn't any obvious reason for it; the driver doesn't release any references after elo_remove() returns and we know that the usb_device structure won't be deallocated before the driver gets unbound.Salah sent a bunch of these. The reasoning was explained in this email. https://www.spinics.net/lists/kernel/msg4026672.html When he resent the patch, Greg said that taking the reference wasn't needed so the patch wasn't applied. (Also it had the same reference leak so that's a second reason it wasn't applied).
Sorry for late response, I've been away for a week. I have now queued revert of all this mess and will be sending it to Linus for 5.17 still. Thanks everybody for reporting. -- Jiri Kosina SUSE Labs