From aa63e6562ab38f838fd7e3e5d6708495dd144c05 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 22 Dec 2021 22:28:07 +0100 Subject: [PATCH] pinctrl: imx: fix allocation result check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix code to check correct variable value. Reported-by: Abel Vesa Fixes: 02f117134952 ("pinctrl: imx: prepare for making "group_names" in "function_desc" const") Signed-off-by: Rafał Miłecki Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20211222212807.27122-1-zajec5@gmail.com Signed-off-by: Linus Walleij --- drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 47b2ab1..16bc1bf 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -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; -- 2.7.4