Re: [PATCH v6 08/12] Input: xbox_gip - Add arcade stick support

From
sashiko-bot@kernel.org
Date
2026-09-08 03:35:13
Reply to
Vicki Pfau, 2026-09-08
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `gip_handle_arcade_stick_report` function returns `-EINVAL` on short packets after successfully reporting key events, bypassing `input_sync()`.
--

commit 52729645cd0e478b1045c3e2e7b193ab5b91d1c7
Author: Vicki Pfau [off-list ref]

    Input: xbox_gip - Add arcade stick support
    
    This adds support for the arcade stick device type. Currently I'm only
    aware of one Xbox controller that uses this device type, the Razer Atrox,
    so testing coverage is limited.
quoted hunk ↗ jump to hunk
diff --git a/drivers/input/joystick/gip/gip-arcade-stick.c b/drivers/input/joystick/gip/gip-arcade-stick.c
new file mode 100644
index 0000000000000..11ededfab8555
--- /dev/null
+++ b/drivers/input/joystick/gip/gip-arcade-stick.c
[ ... ]
quoted hunk ↗ jump to hunk
+static int gip_handle_arcade_stick_report(struct gip_attachment *attachment,
+	struct input_dev *input, const uint8_t *bytes, int num_bytes)
+{
+	struct gip_arcade_stick_info *info = attachment->driver_data;
+	int rc;
+
+	if (!info)
+		return -ENODEV;
+
+	rc = gip_driver_navigation.handle_input_report(attachment, input, bytes, num_bytes);
+	if (rc < 0)
+		return rc;
+
+	if (num_bytes < 6) {
+		gip_dbg(attachment, "Discarding too-short input report\n");
+		return -EINVAL;
+	}
[Severity: Medium]
If the input report packet is between 2 and 5 bytes long, does this sequence
skip the required input_sync() call?

gip_driver_navigation.handle_input_report() will successfully process the
first few bytes and queue key events. Returning -EINVAL here propagates the
error to the caller, which then aborts and skips the input_sync() call for
the already queued events.

Should the size check for num_bytes < 6 be performed before delegating to
the navigation driver to prevent leaving unsynchronized events in the input
core?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260908032145.2118234-1-vi@endrift.com?part=8
Thread (23 messages) 23 messages, 2 authors, last reply 2026-09-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help