pinctrl: stm32: Add check for devm_kcalloc
authorChen Ni <nichen@iscas.ac.cn>
Tue, 31 Oct 2023 08:08:07 +0000 (08:08 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:52:21 +0000 (08:52 +0100)
commit3e3fa8056fd259f34e6f0c02b54d17893114c909
tree9868d55065cbcb5981362e4bc21ba39be8a2d2b8
parent4a7e92551618f3737b305f62451353ee05662f57
pinctrl: stm32: Add check for devm_kcalloc

[ Upstream commit b0eeba527e704d6023a6cd9103f929226e326b03 ]

Add check for the return value of devm_kcalloc() and return the error
if it fails in order to avoid NULL pointer dereference.

Fixes: 32c170ff15b0 ("pinctrl: stm32: set default gpio line names using pin names")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Acked-by: Valentin Caron <valentin.caron@foss.st.com>
Link: https://lore.kernel.org/r/20231031080807.3600656-1-nichen@iscas.ac.cn
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/stm32/pinctrl-stm32.c