pinctrl: tegra: Fix off by one in tegra_pinctrl_get_group()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 19 Mar 2025 07:05:47 +0000 (10:05 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 20 Mar 2025 08:12:44 +0000 (09:12 +0100)
commit5a062c3c3b82004766bc3ece82b594d337076152
treef346caa7fc135f9d07ce3fabbd2035ab1b14e9cb
parent813b1a1a21fea47405dc44694c3031c3efcf0f03
pinctrl: tegra: Fix off by one in tegra_pinctrl_get_group()

This should be >= pmx->soc->ngroups instead of > to avoid an out of
bounds access.  The pmx->soc->groups[] array is allocated in
tegra_pinctrl_probe().

Fixes: c12bfa0fee65 ("pinctrl-tegra: Restore SFSEL bit when freeing pins")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Kunwu Chan <kunwu.chan@linux.dev>
Link: https://lore.kernel.org/82b40d9d-b437-42a9-9eb3-2328aa6877ac@stanley.mountain
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/tegra/pinctrl-tegra.c