]> git.ipfire.org Git - thirdparty/linux.git/commit
HID: u2fzero: free allocated URB on probe errors
authorMyeonghun Pak <mhun512@gmail.com>
Fri, 24 Apr 2026 13:21:31 +0000 (22:21 +0900)
committerBenjamin Tissoires <bentiss@kernel.org>
Thu, 21 May 2026 13:47:17 +0000 (15:47 +0200)
commit2e78b21864dd6e21b76160753ea632b5e758fdbd
tree9e271f4d155418f9e93fe8dc4b8a0417a135add7
parent64ffa2e5e02ff54b23221d0282155f37283fabea
HID: u2fzero: free allocated URB on probe errors

u2fzero_fill_in_urb() allocates dev->urb with usb_alloc_urb(), but
u2fzero_probe() ignored its return value and only freed the URB from
u2fzero_remove().

If LED or hwrng registration fails after the URB allocation, probe returns
an error and the driver core does not call .remove(), leaking the URB. A
failed URB setup was also allowed to continue probing with an unusable
device.

Check the URB setup result and add the missing probe-error unwind so the
URB is freed before returning from later errors.

Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-u2fzero.c