Commit 09f8101d authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Linus Walleij

pinctrl: ralink: rt2880: add missing NULL check

Memory is being requested to the kernel but there is
a missing check for NULL. Hence, add it.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201213161721.6514-5-sergio.paracuellos@gmail.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 7391031b
......@@ -238,6 +238,8 @@ static int rt2880_pinmux_index(struct rt2880_priv *p)
p->func[c] = &p->groups[i].func[j];
p->func[c]->groups = devm_kzalloc(p->dev, sizeof(int),
GFP_KERNEL);
if (!p->func[c]->groups)
return -ENOMEM;
p->func[c]->groups[0] = i;
p->func[c]->group_count = 1;
c++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment