linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abel Vesa <abel.vesa@nxp.com>
To: Jian Dong <dj0227@163.com>
Cc: mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, linux-imx@nxp.com,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, huyue2@yulong.com,
	Jian Dong <dongjian@yulong.com>
Subject: Re: [PATCH]  clk: imx: reference preceded by free
Date: Tue, 30 Mar 2021 12:17:18 +0300	[thread overview]
Message-ID: <20210330091718.xd6phttmlyoegsnq@fsr-ub1664-175> (raw)
In-Reply-To: <1616469034-9691-1-git-send-email-dj0227@163.com>

On 21-03-23 11:10:34, Jian Dong wrote:
> From: Jian Dong <dongjian@yulong.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@yulong.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
> 
> 

  reply	other threads:[~2021-03-30  9:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23  3:10 [PATCH] clk: imx: reference preceded by free Jian Dong
2021-03-30  9:17 ` Abel Vesa [this message]
2021-03-31  2:16 ` Stephen Boyd
2021-04-08  1:53   ` Jian Dong
2021-04-08  7:41     ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210330091718.xd6phttmlyoegsnq@fsr-ub1664-175 \
    --to=abel.vesa@nxp.com \
    --cc=dj0227@163.com \
    --cc=dongjian@yulong.com \
    --cc=huyue2@yulong.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).