mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 09:31:26 +00:00
pinctrl: imx: fix allocation result check
Fix code to check correct variable value.
Reported-by: Abel Vesa <abel.vesa@nxp.com>
Fixes: 02f1171349
("pinctrl: imx: prepare for making "group_names" in "function_desc" const")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Link: https://lore.kernel.org/r/20211222212807.27122-1-zajec5@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
ce85283733
commit
aa63e6562a
@ -667,7 +667,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
|
||||
|
||||
group_names = devm_kcalloc(ipctl->dev, func->num_group_names,
|
||||
sizeof(char *), GFP_KERNEL);
|
||||
if (!func->group_names)
|
||||
if (!group_names)
|
||||
return -ENOMEM;
|
||||
for_each_child_of_node(np, child)
|
||||
group_names[i] = child->name;
|
||||
|
Loading…
Reference in New Issue
Block a user