usb: gadget: f_hid: fixed NULL pointer dereference
authorPhil Elwell <phil@raspberrypi.com>
Fri, 23 Jul 2021 15:59:30 +0000 (18:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Aug 2021 11:32:15 +0000 (13:32 +0200)
commitb27bb0d8988e0c5000c35cf52faed3cec118a9b4
tree22d2fdc42fe3fba418f057a450aed5e972e2e143
parent12620d8780ddadcfab98a6e540031f625bbb0764
usb: gadget: f_hid: fixed NULL pointer dereference

commit 2867652e4766360adf14dfda3832455e04964f2a upstream.

Disconnecting and reconnecting the USB cable can lead to crashes
and a variety of kernel log spam.

The problem was found and reproduced on the Raspberry Pi [1]
and the original fix was created in Raspberry's own fork [2].

Link: https://github.com/raspberrypi/linux/issues/3870
Link: https://github.com/raspberrypi/linux/commit/a6e47d5f4efbd2ea6a0b6565cd2f9b7bb217ded5
Signed-off-by: Maxim Devaev <mdevaev@gmail.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210723155928.210019-1-mdevaev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_hid.c