Skip to content

Commit ca1547a

Browse files
ssekar15jic23
authored andcommitted
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: 7abd9fb ("iio: adc: mp2629: Add support for mp2629 ADC driver") Signed-off-by: Saravanan Sekar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 1eb2033 commit ca1547a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iio/adc/mp2629_adc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ static struct iio_map mp2629_adc_maps[] = {
5757
MP2629_MAP(SYSTEM_VOLT, "system-volt"),
5858
MP2629_MAP(INPUT_VOLT, "input-volt"),
5959
MP2629_MAP(BATT_CURRENT, "batt-current"),
60-
MP2629_MAP(INPUT_CURRENT, "input-current")
60+
MP2629_MAP(INPUT_CURRENT, "input-current"),
61+
{ }
6162
};
6263

6364
static int mp2629_read_raw(struct iio_dev *indio_dev,

0 commit comments

Comments
 (0)