Commit 7391031b authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Linus Walleij

pinctrl: ralink: rt2880: return proper error code

Check for NULL shall return '-ENOMEM' instead of '-1'.
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-4-sergio.paracuellos@gmail.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 53abfe67
...@@ -206,7 +206,7 @@ static int rt2880_pinmux_index(struct rt2880_priv *p) ...@@ -206,7 +206,7 @@ static int rt2880_pinmux_index(struct rt2880_priv *p)
p->group_names = devm_kcalloc(p->dev, p->group_count, p->group_names = devm_kcalloc(p->dev, p->group_count,
sizeof(char *), GFP_KERNEL); sizeof(char *), GFP_KERNEL);
if (!p->group_names) if (!p->group_names)
return -1; return -ENOMEM;
for (i = 0; i < p->group_count; i++) { for (i = 0; i < p->group_count; i++) {
p->group_names[i] = p->groups[i].name; p->group_names[i] = p->groups[i].name;
......
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