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: <01256fbd0ec5c14e30027be902e89b65ab921970.camel@nxp.com>
Date:   Tue, 6 Aug 2019 09:17:07 +0000
From:   Daniel Baluta <daniel.baluta@....com>
To:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Fancy Fang <chen.fang@....com>,
        "mturquette@...libre.com" <mturquette@...libre.com>,
        "festevam@...il.com" <festevam@...il.com>,
        "sboyd@...nel.org" <sboyd@...nel.org>,
        Jacky Bai <ping.bai@....com>, Jun Li <jun.li@....com>,
        "agx@...xcpu.org" <agx@...xcpu.org>, Abel Vesa <abel.vesa@....com>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        Anson Huang <anson.huang@....com>,
        "linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
        Peng Fan <peng.fan@....com>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        Leonard Crestez <leonard.crestez@....com>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>
CC:     dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH 2/2] clk: imx8mq: Unregister clks when of_clk_add_provider
 failed

On Tue, 2019-08-06 at 14:46 +0800, Anson.Huang@....com wrote:
> From: Anson Huang <Anson.Huang@....com>
> 
> When of_clk_add_provider failed, all clks should be unregistered.
> 
> Signed-off-by: Anson Huang <Anson.Huang@....com>

Reviewed-by: Daniel Baluta <daniel.baluta@....com>

> ---
>  drivers/clk/imx/clk-imx8mq.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk-imx8mq.c b/drivers/clk/imx/clk-
> imx8mq.c
> index 04302f2..81a0249 100644
> --- a/drivers/clk/imx/clk-imx8mq.c
> +++ b/drivers/clk/imx/clk-imx8mq.c
> @@ -562,10 +562,18 @@ static int imx8mq_clocks_probe(struct
> platform_device *pdev)
>  	clk_data.clk_num = ARRAY_SIZE(clks);
>  
>  	err = of_clk_add_provider(np, of_clk_src_onecell_get,
> &clk_data);
> -	WARN_ON(err);
> +	if (err < 0) {
> +		dev_err(dev, "failed to register clks for i.MX8MQ\n");
> +		goto unregister_clks;
> +	}
>  
>  	imx_register_uart_clocks(uart_clks);
>  
> +	return 0;
> +
> +unregister_clks:
> +	imx_unregister_clocks(clks, ARRAY_SIZE(clks));
> +
>  	return err;
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ