mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
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: 7abd9fb646
("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>
This commit is contained in:
parent
1eb20332a0
commit
ca1547ab15
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user