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]
Date:	Mon, 23 Dec 2013 16:24:02 +0800
From:	Shawn Guo <shawn.guo@...aro.org>
To:	Fabio Estevam <festevam@...il.com>
CC:	<broonie@...nel.org>, <Anson.Huang@...escale.com>,
	<linux-kernel@...r.kernel.org>,
	Fabio Estevam <fabio.estevam@...escale.com>
Subject: Re: [PATCH v2 1/2] regulator: anatop-regulator: Only jump to
 'anatop_probe_end' on error

On Sat, Dec 21, 2013 at 05:27:25PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@...escale.com>
> 
> Currently 'anatop_probe_end' path is executed on both succesfull and error paths
> of anatop_regulator_probe().
> 
> To let the code a bit clearer, make 'anatop_probe_end' to be executed only when
> an error happens.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@...escale.com>
> ---
>  drivers/regulator/anatop-regulator.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
> index c734d09..53e6048 100644
> --- a/drivers/regulator/anatop-regulator.c
> +++ b/drivers/regulator/anatop-regulator.c
> @@ -210,9 +210,10 @@ static int anatop_regulator_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, rdev);
>  
> +	return 0;
> +
>  anatop_probe_end:
> -	if (ret)
> -		kfree(sreg->name);
> +	kfree(sreg->name);

While you're there, you may wan to fix the return check of of_get_parent() in
anatop_regulator_probe() as well.

Shawn

>  
>  	return ret;
>  }
> -- 
> 1.8.1.2
> 

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