mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe
[ Upstream commit776dac5a66] devm_kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes:05bd97fc55("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>
This commit is contained in:
parent
e8d3872b61
commit
e9ed74393c
|
|
@ -1118,6 +1118,8 @@ static int vsc73xx_gpio_probe(struct vsc73xx *vsc)
|
|||
|
||||
vsc->gc.label = devm_kasprintf(vsc->dev, GFP_KERNEL, "VSC%04x",
|
||||
vsc->chipid);
|
||||
if (!vsc->gc.label)
|
||||
return -ENOMEM;
|
||||
vsc->gc.ngpio = 4;
|
||||
vsc->gc.owner = THIS_MODULE;
|
||||
vsc->gc.parent = vsc->dev;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user