]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: nuvoton: npcm8xx: Add NULL check in npcm8xx_gpio_fw
authorCharles Han <hanchunchao@inspur.com>
Wed, 12 Feb 2025 10:05:32 +0000 (18:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:09 +0000 (12:54 -0700)
commita585f6ea42ec259a9a57e3e2580fa527c92187d0
treec7193c4635213811e8a3b0f12c7026d071714c40
parent319900a10835d08c281cbad3ea3723d62e6f13f1
pinctrl: nuvoton: npcm8xx: Add NULL check in npcm8xx_gpio_fw

[ Upstream commit acf40ab42799e4ae1397ee6f5c5941092d66f999 ]

devm_kasprintf() calls can return null pointers on failure.
But the return values were not checked in npcm8xx_gpio_fw().
Add NULL check in npcm8xx_gpio_fw(), to handle kernel NULL
pointer dereference error.

Fixes: acf4884a5717 ("pinctrl: nuvoton: add NPCM8XX pinctrl and GPIO driver")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Link: https://lore.kernel.org/20250212100532.4317-1-hanchunchao@inspur.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c