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] [thread-next>] [day] [month] [year] [list]
Message-ID: <377a917b-96b1-14ff-ee57-f841e12c3b41@samsung.com>
Date:   Fri, 27 May 2022 18:09:23 +0900
From:   Chanwoo Choi <cw00.choi@...sung.com>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>, s.nawrocki@...sung.com,
        tomasz.figa@...il.com, alim.akhtar@...sung.com,
        mturquette@...libre.com, sboyd@...nel.org,
        krzysztof.kozlowski@...aro.org
Cc:     linux-samsung-soc@...r.kernel.org, linux-clk@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clk: samsung: Add check for platform_driver_register

On 5/26/22 7:12 PM, Jiasheng Jiang wrote:
> As platform_driver_register() could fail, it should be better
> to deal with the return value in order to maintain the code
> consisitency.
> 
> Fixes: b06a532bf1fa ("clk: samsung: Add Exynos5 sub-CMU clock driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>  drivers/clk/samsung/clk-exynos5-subcmu.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk-exynos5-subcmu.c b/drivers/clk/samsung/clk-exynos5-subcmu.c
> index 65c82d922b05..8b090481a9dc 100644
> --- a/drivers/clk/samsung/clk-exynos5-subcmu.c
> +++ b/drivers/clk/samsung/clk-exynos5-subcmu.c
> @@ -188,8 +188,18 @@ static struct platform_driver exynos5_clk_driver __refdata = {
>  
>  static int __init exynos5_clk_drv_init(void)
>  {
> -	platform_driver_register(&exynos5_clk_driver);
> -	platform_driver_register(&exynos5_subcmu_driver);
> +	int ret;
> +
> +	ret = platform_driver_register(&exynos5_clk_driver);
> +	if (ret)
> +		return ret;
> +
> +	ret = platform_driver_register(&exynos5_subcmu_driver);
> +	if (ret) {
> +		platform_driver_unregister(&exynos5_clk_driver);
> +		return ret;
> +	}
> +
>  	return 0;
>  }
>  core_initcall(exynos5_clk_drv_init);
> 

Acked-by: Chanwoo Choi <cw00.choi@...sung.com>

Thanks.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ