Re: [PATCH 01/10] Input: adi - prevent off-by-one write in adi_read_packet()

From: Dmitry Torokhov

Date: Mon Nov 30 2026 - 00:42:34 EST


Hi Lee,

On Fri, Nov 27, 2026 at 08:09:55PM +0000, Lee Jones wrote:
> Compare adi[i].ret against ADI_MAX_LENGTH - 1 so the pre-incremented
> index always stays within bounds.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Closes: https://sashiko.dev/#/bug/linux-951334ec-a996-4dc4-a03b-d7e6f716e5de
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>

I already had a larger adi rework queued locally (including this fix),
and this patch also does more than strictly necessary by reformatting the
unrelated "else" branch, so I am going to post my series instead and CC
you on it.

Also, there are barely any systems left with gameport adapters, so having
a rogue device attached is not a practical concern and we do not need to
mark this for stable.

Thanks.

--
Dmitry