mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
pinctrl: renesas: rza2: Fix potential NULL pointer dereference
`chip.label` in rza2_gpio_register() could be NULL. Add the missing check. Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Link: https://lore.kernel.org/20250210232552.1545887-1-chenyuan0y@gmail.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
This commit is contained in:
parent
b2bd65fbb6
commit
f752ee5b5b
|
|
@ -246,6 +246,9 @@ static int rza2_gpio_register(struct rza2_pinctrl_priv *priv)
|
|||
int ret;
|
||||
|
||||
chip.label = devm_kasprintf(priv->dev, GFP_KERNEL, "%pOFn", np);
|
||||
if (!chip.label)
|
||||
return -ENOMEM;
|
||||
|
||||
chip.parent = priv->dev;
|
||||
chip.ngpio = priv->npins;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user