]> git.ipfire.org Git - thirdparty/linux.git/commit
usb: gadget: f_hid: wake up readers on disable/unbind
authorPeter Korsgaard <peter@korsgaard.com>
Tue, 18 Mar 2025 15:22:07 +0000 (16:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2025 14:08:33 +0000 (16:08 +0200)
commit937a8a3a8d46a3377b4195cd8f2aa656666ebc8b
tree33194c2d229c2f93802fe2d43a6de4a98c849739
parent24454a11dd1551cd202a46a6fd69c65a1a368903
usb: gadget: f_hid: wake up readers on disable/unbind

Similar to how it is done in the write path.

Add a disabled flag to track the function state and use it to exit the read
loops to ensure no readers get stuck when the function is disabled/unbound,
protecting against corruption when the waitq and spinlocks are reinitialized
in hidg_bind().

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Link: https://lore.kernel.org/r/20250318152207.330997-1-peter@korsgaard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_hid.c