[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210330091718.xd6phttmlyoegsnq@fsr-ub1664-175>
Date: Tue, 30 Mar 2021 12:17:18 +0300
From: Abel Vesa <abel.vesa@....com>
To: Jian Dong <dj0227@....com>
Cc: mturquette@...libre.com, sboyd@...nel.org, shawnguo@...nel.org,
s.hauer@...gutronix.de, linux-imx@....com,
linux-clk@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, huyue2@...ong.com,
Jian Dong <dongjian@...ong.com>
Subject: Re: [PATCH] clk: imx: reference preceded by free
On 21-03-23 11:10:34, Jian Dong wrote:
> From: Jian Dong <dongjian@...ong.com>
>
> when register failed, clk will be freed, it will generate dangling pointer
> problem in later reference. it should return directly.
>
> Signed-off-by: Jian Dong <dongjian@...ong.com>
Applied, thanks.
> ---
> drivers/clk/imx/clk-lpcg-scu.c | 1 +
> drivers/clk/imx/clk-scu.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/clk/imx/clk-lpcg-scu.c b/drivers/clk/imx/clk-lpcg-scu.c
> index 77be763..dd5abd0 100644
> --- a/drivers/clk/imx/clk-lpcg-scu.c
> +++ b/drivers/clk/imx/clk-lpcg-scu.c
> @@ -114,6 +114,7 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name,
> if (ret) {
> kfree(clk);
> hw = ERR_PTR(ret);
> + return hw;
> }
>
> if (dev)
> diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
> index 1f5518b7..f89b4da 100644
> --- a/drivers/clk/imx/clk-scu.c
> +++ b/drivers/clk/imx/clk-scu.c
> @@ -426,6 +426,7 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name,
> if (ret) {
> kfree(clk);
> hw = ERR_PTR(ret);
> + return hw;
> }
>
> if (dev)
> --
> 1.9.1
>
>
Powered by blists - more mailing lists