From: sashiko-bot@kernel.org
To: "Vicki Pfau" <vi@endrift.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH v5 08/12] Input: xbox_gip - Add arcade stick support
Date: Wed, 02 Sep 2026 01:24:22 +0000 [thread overview]
Message-ID: <20260902012422.983921F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260902010237.865772-9-vi@endrift.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing `input_sync()` when discarding too-short reports, leaving events stuck in the input core buffers.
--
commit 11239c49a7f8de98682a983be88f926f7595b94d
Author: Vicki Pfau <vi@endrift.com>
Input: xbox_gip - Add arcade stick support
This adds support for the arcade stick device type to the xbox_gip driver.
Currently only the Razer Atrox controller is known to use this type.
> 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
[ ... ]
> +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]
When an input report is received with a length between 2 and 5 bytes,
gip_driver_navigation.handle_input_report() successfully parses the first
two bytes and calls input_report_key() and input_report_abs() to update the
device state.
If num_bytes < 6, this error path in gip_handle_arcade_stick_report() returns
-EINVAL before the device state can be synchronized. This error code is
propagated back to the caller in drivers/input/joystick/gip/gip-core.c
(gip_handle_ll_input_report()), which then immediately returns without calling
input_sync(input).
Because of this early return, does the driver leave the reported key and axis
events buffered in the input core without flushing them to userspace? Could
this result in missed or delayed events if the hardware sends unexpectedly
short event packets?
> +
> + if (info->actuator_bias > 0) {
> + input_report_abs(input, ABS_X, get_unaligned_le16(&bytes[2]) - info->actuator_bias);
> + input_report_abs(input, ABS_Y, get_unaligned_le16(&bytes[4]) - info->actuator_bias);
> + }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260902010237.865772-1-vi@endrift.com?part=8
next prev parent reply other threads:[~2026-09-02 1:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 1:02 [PATCH v5 00/12] Input: xbox_gip - Add new driver for Xbox GIP Vicki Pfau
2026-09-02 1:02 ` [PATCH v5 01/12] " Vicki Pfau
2026-09-02 1:28 ` sashiko-bot
2026-09-02 1:02 ` [PATCH v5 02/12] Input: xpad - Remove Xbox One support Vicki Pfau
2026-09-02 1:02 ` [PATCH v5 03/12] Input: xbox_gip - Add controllable LED support Vicki Pfau
2026-09-02 1:20 ` sashiko-bot
2026-09-02 1:02 ` [PATCH v5 04/12] Input: xbox_gip - Add HID relaying Vicki Pfau
2026-09-02 1:22 ` sashiko-bot
2026-09-02 1:02 ` [PATCH v5 05/12] Input: xbox_gip - Add battery support Vicki Pfau
2026-09-02 1:20 ` sashiko-bot
2026-09-02 1:02 ` [PATCH v5 06/12] Input: xbox_gip - Allow sending fragmented and ACME messages Vicki Pfau
2026-09-02 1:19 ` sashiko-bot
2026-09-02 1:02 ` [PATCH v5 07/12] Input: xbox_gip - Add security implementation from xone Vicki Pfau
2026-09-02 1:20 ` sashiko-bot
2026-09-02 1:02 ` [PATCH v5 08/12] Input: xbox_gip - Add arcade stick support Vicki Pfau
2026-09-02 1:24 ` sashiko-bot [this message]
2026-09-02 1:02 ` [PATCH v5 09/12] Input: xbox_gip - Add support for PDP guitar controllers Vicki Pfau
2026-09-02 1:02 ` [PATCH v5 10/12] Input: Add ABS_CLUTCH, HANDBRAKE, and SHIFTER Vicki Pfau
2026-09-02 1:23 ` sashiko-bot
2026-09-02 1:02 ` [PATCH v5 11/12] HID: Map more automobile simulation inputs Vicki Pfau
2026-09-02 1:02 ` [PATCH v5 12/12] Input: xbox_gip - Add wheel support Vicki Pfau
2026-09-02 1:33 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260902012422.983921F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vi@endrift.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox