net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe
authorKunwu Chan <chentao@kylinos.cn>
Thu, 11 Jan 2024 07:20:18 +0000 (15:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:58 +0000 (15:35 -0800)
commite9ed74393c0919ced00e8f5d08d47a8b265b4576
tree04bbbda8e8066ffaa7d29d7a1b620dd542c6ef85
parente8d3872b617c21100c5ee4f64e513997a68c2e3d
net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe

[ Upstream commit 776dac5a662774f07a876b650ba578d0a62d20db ]

devm_kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240111072018.75971-1-chentao@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/vitesse-vsc73xx-core.c