Skip to contentSkip to conversation

patch "iio: adc: mp2629: fix potential array out of bound access" added to char-misc-linus

PATCH [email protected] 1 participant 1 message Nov 5, 2022

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: adc: mp2629: fix potential array out of bound access

to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From ca1547ab15f48dc81624183ae17a2fd1bad06dfc Mon Sep 17 00:00:00 2001
From: Saravanan Sekar <[email protected]>
Date: Sat, 29 Oct 2022 11:29:55 +0200
Subject: iio: adc: mp2629: fix potential array out of bound access

Add sentinel at end of maps to avoid potential array out of bound access in iio core.

Fixes 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver")
---
 drivers/iio/adc/mp2629_adc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/mp2629_adc.c +2 -1
index f7af9af1665d..88e947f300cf 100644
@@ -57,7 +57,8 @@ static struct iio_map mp2629_adc_maps[] = {
 	MP2629_MAP(SYSTEM_VOLT, "system-volt"),
 	MP2629_MAP(INPUT_VOLT, "input-volt"),
 	MP2629_MAP(BATT_CURRENT, "batt-current"),
-	MP2629_MAP(INPUT_CURRENT, "input-current")
+	MP2629_MAP(INPUT_CURRENT, "input-current"),
+	{ }
 };
 
 static int mp2629_read_raw(struct iio_dev *indio_dev,
Signature · 1 line
2.38.1