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 <sravanhome@gmail.com> Link: https://lore.kernel.org/r/20221029093000.45451-4-sravanhome@gmail.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 1eb2033 commit ca1547a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)