Re: [PATCH] i2c: atr: fix race condition caused by static local variable in i2c_atr_map_msgs()

From: Romain Gantois

Date: Mon Nov 02 2026 - 04:36:55 EST


On Thu, 29 Oct 2026 09:25:26 +0100, "Luca Ceresoli" <luca.ceresoli@xxxxxxxxxxx> wrote:
> Was this potential bug observed on real hardware? I'm a bit surprised
> nobody noticed before.
>
> Also, if it's a bugfix, it should have a Fixes: tag and possibly Cc:
> stable.
>
> Code-wise it looks OK. Not sure a bug can really happen but I don't see any
> reason this variable should be static: it is always set before being read
> by this function.
>

Thanks for the Cc Luca. I agree with the need to add a Fixes: tag and
Cc: for stable.

Apart from this, the change looks valid to me, as there is really no
reason for this variable to be declared as static.

--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com