[PATCH] pinctrl: imx: fix allocation result check

Abel Vesa abel.vesa at nxp.com
Wed Dec 22 23:56:36 PST 2021


On 21-12-22 22:28:07, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal at milecki.pl>
> 
> Fix code to check correct variable value.
> 
> Reported-by: Abel Vesa <abel.vesa at nxp.com>

Reviewed-by: Abel Vesa <abel.vesa at nxp.com>

> Fixes: 02f117134952 ("pinctrl: imx: prepare for making "group_names" in "function_desc" const")
> Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
> ---
> Linus: I'm not sure if you can rebase your tree. Treat it as separated
> patch or fixup. Depending on how to manage your repository.
> ---
>  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 47b2ab1a14d0..16bc1bfc03e4 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.31.1
>



More information about the linux-arm-kernel mailing list