]> git.hungrycats.org Git - linux/commit
pinctrl: freescale: Fix a memory out of bounds when num_configs is 1
authorXiaolei Wang <xiaolei.wang@windriver.com>
Thu, 4 May 2023 23:37:36 +0000 (07:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:48 +0000 (19:39 +0200)
commitf85d3cb10f4df5ae3bdb9a9357315c28d781651f
treed680055eca0ec54b4753910e334e73e14e62ad78
parentdb8657fdd53c5e3069149d7f957cb60e63027bb2
pinctrl: freescale: Fix a memory out of bounds when num_configs is 1

[ Upstream commit 9063777ca1e2e895c5fdd493ee0c3f18fa710ed4 ]

The config passed in by pad wakeup is 1, when num_configs is 1,
Configuration [1] should not be fetched, which will be detected
by KASAN as a memory out of bounds condition. Modify to get
configs[1] when num_configs is 2.

Fixes: f60c9eac54af ("gpio: mxc: enable pad wakeup on i.MX8x platforms")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20230504233736.3766296-1-xiaolei.wang@windriver.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/freescale/pinctrl-scu.c