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)
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>
Mon, 19 Dec 2022 11:06:44 +0000 (12:06 +0100)
commit0e13e7b448005612972eae36c0f698c21d1e2f8a
treed24e040094ea8f8d38fbaee51c4ee9aa2ddd53c7
parent2043f9a37d163ef4f572992bec7cdcdf54d965de
HID: logitech-hidpp: Guard FF init code against non-USB devices

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
drivers/hid/hid-logitech-hidpp.c