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

Jonathan Cameron <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <20260817023740.1b07559f@jic23-huawei>
On Wed, 12 Aug 2026 13:43:35 +0200
Mehdi Djait <[email protected]> wrote:

> 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]>
Applied thanks,

Jonathan

> 
> > 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.