Re: [PATCH 3/3] Input: xpad - add support for generic clone X-Input gamepads
From: sashiko-bot@kernel.org
Date: 2026-07-26 13:33:42
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Improper USB Device Matching causing interface hijacking --
--- Patch [3]: [PATCH 3/3] Input: xpad - add support for generic clone X-Input gamepads ---commit 8d8bacca3354683f27c3566047a8b73e337bdddd Author: Ishaan Dandekar [off-list ref] Input: xpad - add support for generic clone X-Input gamepads This commit adds support for a generic X-Input gamepad (0283:0001) by adding its vendor and product IDs to xpad_device and xpad_table to initialize it as an X-Input gamepad.
quoted hunk ↗ jump to hunk
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -496,6 +497,7 @@ static const struct usb_device_id xpad_table[] = { */ { USB_INTERFACE_INFO('X', 'B', 0) }, /* Xbox USB-IF not-approved class */ XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 controller */ + { USB_DEVICE(0x0283, 0x0001) }, /* Generic X-Input Gamepad */
[Severity: Medium] Will this binding hijack other interfaces on the composite USB device? By using USB_DEVICE() here, the match flags are set to USB_DEVICE_ID_MATCH_DEVICE, which drops interface-level matching. Because this device is statically mapped to XTYPE_XBOX360 in xpad_device[], xpad_probe() will skip the XTYPE_UNKNOWN interface class check. Does this cause the xpad driver to bind to all interfaces on the device (such as audio or standard HID) that happen to have one IN and one OUT endpoint, stealing them from their correct drivers and creating ghost input nodes? Should this use XPAD_XBOX360_VENDOR(0x0283) or explicitly match the USB_CLASS_VENDOR_SPEC interface class instead? -- Sashiko AI review · https://sashiko.dev/#/patchset/20260726132039.28330-1-ishaan.dandekar@gmail.com?part=3