summaryrefslogtreecommitdiff
path: root/drivers/iio/adc
diff options
context:
space:
mode:
authorSaravanan Sekar <sravanhome@gmail.com>2022-10-29 12:29:55 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-11-01 11:48:02 +0300
commitca1547ab15f48dc81624183ae17a2fd1bad06dfc (patch)
treef68281db67ede89759f4aab03eae14f61372de9f /drivers/iio/adc
parent1eb20332a082fa801fb89c347c5e62de916a4001 (diff)
downloadlinux-ca1547ab15f48dc81624183ae17a2fd1bad06dfc.tar.xz
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") 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>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r--drivers/iio/adc/mp2629_adc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/adc/mp2629_adc.c b/drivers/iio/adc/mp2629_adc.c
index f7af9af1665d..88e947f300cf 100644
--- a/drivers/iio/adc/mp2629_adc.c
+++ b/drivers/iio/adc/mp2629_adc.c
@@ -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,