Skip to content

HID: lenovo-go: clean up USB assumption

Louis Clinckx linux-input lkml sashiko-reviews 1 version Applied

Status from this message: Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git (for-7.1/upstream-fixes), thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 3 repliesApplied

Changes in v2 from the cover letter

- Resubmitted on linux-input as a quality fix per Benjamin's review of v1 (sent to [email protected]; the HID_USB_DEVICE() id_table already filters BUS_USB, so no exploitable path).
- Added patch 2 to remove the dead NULL check, at Derek's suggestion.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2HID: lenovo-go: reject non-USB transports in probedrivers/hid/hid-lenovo-go-s.c drivers/hid/hid-lenovo-go.c+6 -01 reply
2/2HID: lenovo-go: drop dead NULL check on to_usb_interface()drivers/hid/hid-lenovo-go-s.c drivers/hid/hid-lenovo-go.c+3 -80 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDerek J. Clark
SeriesR-b T-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] HID: lenovo-go: clean up USB assumption

These drivers' id_tables only match HID_USB_DEVICE() entries and the code freely assumes a USB transport (to_usb_interface() on hdev->dev.parent, endpoint access in raw_event). Make the assumption explicit at probe and drop a NULL check that the compiler-level definition of to_usb_interface() makes unreachable.

No functional change for the supported (USB) devices.

Louis Clinckx (2):
HID: lenovo-go: reject non-USB transports in probe
HID: lenovo-go: drop dead NULL check on to_usb_interface()

 drivers/hid/hid-lenovo-go-s.c | 11 ++++++-----
 drivers/hid/hid-lenovo-go.c   |  6 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)

---
Changes since v1:
- Resubmitted on linux-input as a quality fix per Benjamin's review of v1 (sent to [email protected]; the HID_USB_DEVICE() id_table already filters BUS_USB, so no exploitable path).
- Added patch 2 to remove the dead NULL check, at Derek's suggestion.

base-commit: 50897c955902c93ae71c38698abb910525ebdc89 --
2.39.5