Antonio Borneo a9659016f9 pinctrl: stm32: fix array read out of bound
[ Upstream commit edd48fd9d45370d6c8ba0dd834fcc51ff688cc87 ]

The existing code does not verify if the "tentative" index exceeds
the size of the array, causing out of bound read.
Issue identified with kasan.

Check the index before using it.

Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Fixes: 32c170ff15b0 ("pinctrl: stm32: set default gpio line names using pin names")
Link: https://lore.kernel.org/r/20231107110520.4449-1-antonio.borneo@foss.st.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-08 08:52:21 +01:00
..
2023-08-25 15:47:18 +02:00
2023-02-22 11:05:56 -08:00
2022-10-24 17:06:48 +03:00
2022-10-24 17:06:48 +03:00
2022-10-24 17:06:48 +03:00
2022-10-24 17:06:48 +03:00