提交 e16955d2 编写于 作者: S Saravanan Sekar 提交者: openeuler-sync-bot

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

stable inclusion
from stable-v5.10.156
commit d95b85c5084ad70011988861ee864529eefa1da0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7MCG1

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d95b85c5084ad70011988861ee864529eefa1da0

--------------------------------

commit ca1547ab upstream.

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

Fixes: 7abd9fb6 ("iio: adc: mp2629: Add support for mp2629 ADC driver")
Signed-off-by: NSaravanan Sekar <sravanhome@gmail.com>
Link: https://lore.kernel.org/r/20221029093000.45451-4-sravanhome@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
(cherry picked from commit ca4a5724)
上级 6905e016
......@@ -56,7 +56,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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册