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: <1400482362.4382.0.camel@AMDC1943>
Date:	Mon, 19 May 2014 08:52:42 +0200
From:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
To:	Axel Lin <axel.lin@...ics.com>
Cc:	Mike Turquette <mturquette@...aro.org>,
	Yadwinder Singh Brar <yadi.brar@...sung.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clk: s2mps11: Simplify s2mps11_clk_probe unwind paths

On nie, 2014-05-18 at 23:51 +0800, Axel Lin wrote:
> The devm_clk_unregister() in probe error paths are not necessary as it will be
> automatically called when probe fails.
> 
> Signed-off-by: Axel Lin <axel.lin@...ics.com>
> ---
>  drivers/clk/clk-s2mps11.c | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>

Best regards,
Krzysztof



> diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
> index f2f62a1b..aeaa61c 100644
> --- a/drivers/clk/clk-s2mps11.c
> +++ b/drivers/clk/clk-s2mps11.c
> @@ -210,7 +210,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
>  					sizeof(struct clk_lookup), GFP_KERNEL);
>  		if (!s2mps11_clk->lookup) {
>  			ret = -ENOMEM;
> -			goto err_lup;
> +			goto err_reg;
>  		}
>  
>  		s2mps11_clk->lookup->con_id = s2mps11_name(s2mps11_clk);
> @@ -231,16 +231,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
>  	platform_set_drvdata(pdev, s2mps11_clks);
>  
>  	return ret;
> -err_lup:
> -	devm_clk_unregister(&pdev->dev, s2mps11_clk->clk);
> +
>  err_reg:
> -	while (s2mps11_clk > s2mps11_clks) {
> -		if (s2mps11_clk->lookup) {
> -			clkdev_drop(s2mps11_clk->lookup);
> -			devm_clk_unregister(&pdev->dev, s2mps11_clk->clk);
> -		}
> -		s2mps11_clk--;
> -	}
> +	while (--i >= 0)
> +		clkdev_drop(s2mps11_clks[i].lookup);
>  
>  	return ret;
>  }

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