Re: [PATCH 10/12] iio: accel: kionix-kx022a: Fix array boundary check

Mehdi Djait <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <anxb3anPmo3zjIV5@mdjait-mobl>
Hi Matti,

Thank you for that patch!

On Mon, Aug 10, 2026 at 10:54:32AM +0300, Matti Vaittinen wrote:
> From: Matti Vaittinen <[email protected]>
> 
> The driver performs a sanity check for an array size, when converting a
> register value to an array index. The check incorrectly accepts the
> sizeof(array) as a last index, when last valid index should be
> sizeof(array) - 1.
> 
> Fix the check by bailing out when index >= sizeof(array).
>  

Reviewed-by: Mehdi Djait <[email protected]>

> Signed-off-by: Matti Vaittinen <[email protected]>
> Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer")

--
Kind Regards
Mehdi Djait
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.