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:
Rafał Miłecki 2021-12-22 22:28:07 +01:00 committed by Linus Walleij
parent ce85283733
commit aa63e6562a

View File

@ -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;