]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: at91: Fix possible out-of-boundary access
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 8 May 2025 20:08:07 +0000 (23:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:11 +0000 (11:07 +0100)
commitf1c1fdc41fbf7e308ced9c86f3f66345a3f6f478
treeb9c3eaff224d5ca00e1bee2872cdc9fdbc23fec5
parente5e6a1643afde8b31f10270dc157edeff6bb5e00
pinctrl: at91: Fix possible out-of-boundary access

[ Upstream commit 762ef7d1e6eefad9896560bfcb9bcf7f1b6df9c1 ]

at91_gpio_probe() doesn't check that given OF alias is not available or
something went wrong when trying to get it. This might have consequences
when accessing gpio_chips array with that value as an index. Note, that
BUG() can be compiled out and hence won't actually perform the required
checks.

Fixes: 6732ae5cb47c ("ARM: at91: add pinctrl support")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Closes: https://lore.kernel.org/r/202505052343.UHF1Zo93-lkp@intel.com/
Link: https://lore.kernel.org/20250508200807.1384558-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/pinctrl-at91.c