提交 aa63e656 编写于 作者: R Rafał Miłecki 提交者: Linus Walleij

pinctrl: imx: fix allocation result check

Fix code to check correct variable value.
Reported-by: NAbel Vesa <abel.vesa@nxp.com>
Fixes: 02f11713 ("pinctrl: imx: prepare for making "group_names" in "function_desc" const")
Signed-off-by: NRafał Miłecki <rafal@milecki.pl>
Reviewed-by: NAbel Vesa <abel.vesa@nxp.com>
Link: https://lore.kernel.org/r/20211222212807.27122-1-zajec5@gmail.comSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 ce852837
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册