Re: [PATCH 10/12] iio: accel: kionix-kx022a: Fix array boundary check
Jonathan Cameron <[email protected]>
| Newsgroups | gmane.linux.kernel.iio,gmane.linux.kernel |
|---|---|
| Message-ID | <20260817023740.1b07559f@jic23-huawei> |
On Wed, 12 Aug 2026 13:43:35 +0200 Mehdi Djait <mehdi.djait-VuQAYsv1563Yd54FQh9/[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 <mehdi.djait-VuQAYsv1563Yd54FQh9/[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