]> git.baikalelectronics.ru Git - kernel.git/commit
HID: logitech-hidpp: Guard FF init code against non-USB devices
authorBastien Nocera <hadess@hadess.net>
Thu, 15 Dec 2022 15:44:16 +0000 (16:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:09 +0000 (13:33 +0100)
commitcac50efe191169c3a8c96a86ee59c68ed63e966b
treeed77e2a8f5d6a60d9b5e01a487da8656fd6dfc85
parentd78fd6d873e3e9c663bbcf815a0422a4856ecd45
HID: logitech-hidpp: Guard FF init code against non-USB devices

commit 063dcf90366559bb5303eaf6f9da46a1c7723ce3 upstream.

The Force Feedback code assumes that all the devices passed to it will
be USB devices, but that might not be the case for emulated devices.
Guard against a crash by checking the device type before poking at USB
properties.

Cc: stable@vger.kernel.org # v5.16+
Reported-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20221215154416.111704-1-hadess@hadess.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-logitech-hidpp.c