* [PATCH] clk: imx: reference preceded by free
@ 2021-03-23 3:10 Jian Dong
2021-03-30 9:17 ` Abel Vesa
2021-03-31 2:16 ` Stephen Boyd
0 siblings, 2 replies; 5+ messages in thread
From: Jian Dong @ 2021-03-23 3:10 UTC (permalink / raw)
To: abel.vesa, mturquette, sboyd, shawnguo, s.hauer
Cc: linux-imx, linux-clk, linux-arm-kernel, linux-kernel, huyue2, Jian Dong
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>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] clk: imx: reference preceded by free
2021-03-23 3:10 [PATCH] clk: imx: reference preceded by free Jian Dong
@ 2021-03-30 9:17 ` Abel Vesa
2021-03-31 2:16 ` Stephen Boyd
1 sibling, 0 replies; 5+ messages in thread
From: Abel Vesa @ 2021-03-30 9:17 UTC (permalink / raw)
To: Jian Dong
Cc: mturquette, sboyd, shawnguo, s.hauer, linux-imx, linux-clk,
linux-arm-kernel, linux-kernel, huyue2, Jian Dong
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
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clk: imx: reference preceded by free
2021-03-23 3:10 [PATCH] clk: imx: reference preceded by free Jian Dong
2021-03-30 9:17 ` Abel Vesa
@ 2021-03-31 2:16 ` Stephen Boyd
2021-04-08 1:53 ` Jian Dong
1 sibling, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2021-03-31 2:16 UTC (permalink / raw)
To: Jian Dong, abel.vesa, mturquette, s.hauer, shawnguo
Cc: linux-imx, linux-clk, linux-arm-kernel, linux-kernel, huyue2, Jian Dong
Quoting Jian Dong (2021-03-22 20:10:34)
> 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>
> ---
Any Fixes tag?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clk: imx: reference preceded by free
2021-03-31 2:16 ` Stephen Boyd
@ 2021-04-08 1:53 ` Jian Dong
2021-04-08 7:41 ` Stephen Boyd
0 siblings, 1 reply; 5+ messages in thread
From: Jian Dong @ 2021-04-08 1:53 UTC (permalink / raw)
To: Stephen Boyd
Cc: abel.vesa, mturquette, s.hauer, shawnguo, linux-imx, linux-clk,
linux-arm-kernel, linux-kernel, huyue2, Jian Dong
On Tue, 30 Mar 2021 19:16:48 -0700
Stephen Boyd <sboyd@kernel.org> wrote:
> Quoting Jian Dong (2021-03-22 20:10:34)
> > 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>
> > ---
>
> Any Fixes tag?
Sorry for late, I'm unfamiliar with tag rule.
For this patch include two files commit 2f77296d3 and fe37b482
maybe likes:
Fixes: 2f77296d3 (clk: imx: add lpcg clock support)
Fixes: fe37b482 (clk: imx: add scu clock common part)
and I noticed this patch has been merged, do I need RESEND again with
tags like above?
Thank you
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clk: imx: reference preceded by free
2021-04-08 1:53 ` Jian Dong
@ 2021-04-08 7:41 ` Stephen Boyd
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2021-04-08 7:41 UTC (permalink / raw)
To: Jian Dong
Cc: abel.vesa, mturquette, s.hauer, shawnguo, linux-imx, linux-clk,
linux-arm-kernel, linux-kernel, huyue2, Jian Dong
Quoting Jian Dong (2021-04-07 18:53:12)
> On Tue, 30 Mar 2021 19:16:48 -0700
> Stephen Boyd <sboyd@kernel.org> wrote:
>
> > Quoting Jian Dong (2021-03-22 20:10:34)
> > > 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>
> > > ---
> >
> > Any Fixes tag?
>
> Sorry for late, I'm unfamiliar with tag rule.
>
> For this patch include two files commit 2f77296d3 and fe37b482
> maybe likes:
>
> Fixes: 2f77296d3 (clk: imx: add lpcg clock support)
> Fixes: fe37b482 (clk: imx: add scu clock common part)
>
> and I noticed this patch has been merged, do I need RESEND again with
> tags like above?
>
Looks like Abel already picked it up so no need to resend.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-04-08 7:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 3:10 [PATCH] clk: imx: reference preceded by free Jian Dong
2021-03-30 9:17 ` Abel Vesa
2021-03-31 2:16 ` Stephen Boyd
2021-04-08 1:53 ` Jian Dong
2021-04-08 7:41 ` Stephen Boyd
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).