lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120607120910.GE8354@shlinux2.ap.freescale.net>
Date:	Thu, 7 Jun 2012 20:09:11 +0800
From:	Dong Aisheng <aisheng.dong@...escale.com>
To:	Devendra Naga <devendra.aaru@...il.com>
CC:	Linus Walleij <linus.walleij@...aro.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] pinctrl: free if of_get_parent fails to get the
 parent node

On Sat, Jun 02, 2012 at 10:34:37PM +0530, Devendra Naga wrote:
> of_get_parent can return null if no parent node found, so the allocated new_map
> should be freed.
> 
> Signed-off-by: Devendra Naga <devendra.aaru@...il.com>
> ---
>  drivers/pinctrl/pinctrl-imx.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
Thanks for fixing.

Acked-by: Dong Aisheng <dong.aisheng@...aro.org>

Regards
Dong Aisheng

> diff --git a/drivers/pinctrl/pinctrl-imx.c b/drivers/pinctrl/pinctrl-imx.c
> index 553ed95..82c1d80 100644
> --- a/drivers/pinctrl/pinctrl-imx.c
> +++ b/drivers/pinctrl/pinctrl-imx.c
> @@ -173,8 +173,10 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
>  
>  	/* create mux map */
>  	parent = of_get_parent(np);
> -	if (!parent)
> +	if (!parent) {
> +		kfree(new_map);
>  		return -EINVAL;
> +	}
>  	new_map[0].type = PIN_MAP_TYPE_MUX_GROUP;
>  	new_map[0].data.mux.function = parent->name;
>  	new_map[0].data.mux.group = np->name;
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ