* [PATCH] clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference
@ 2021-08-26 14:17 Adam Ford
2021-08-26 17:42 ` Geert Uytterhoeven
2021-08-29 4:29 ` Stephen Boyd
0 siblings, 2 replies; 4+ messages in thread
From: Adam Ford @ 2021-08-26 14:17 UTC (permalink / raw)
To: linux-clk; +Cc: sboyd, geert+renesas, mturquette, Adam Ford
The probe was manually passing NULL instead of dev to devm_clk_hw_register.
This caused a Unable to handle kernel NULL pointer dereference error.
Fix this by passing 'dev'.
Signed-off-by: Adam Ford <aford173@gmail.com>
diff --git a/drivers/clk/renesas/rcar-usb2-clock-sel.c b/drivers/clk/renesas/rcar-usb2-clock-sel.c
index 9fb79bd79435..684d8937965e 100644
--- a/drivers/clk/renesas/rcar-usb2-clock-sel.c
+++ b/drivers/clk/renesas/rcar-usb2-clock-sel.c
@@ -187,7 +187,7 @@ static int rcar_usb2_clock_sel_probe(struct platform_device *pdev)
init.ops = &usb2_clock_sel_clock_ops;
priv->hw.init = &init;
- ret = devm_clk_hw_register(NULL, &priv->hw);
+ ret = devm_clk_hw_register(dev, &priv->hw);
if (ret)
goto pm_put;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference
2021-08-26 14:17 [PATCH] clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference Adam Ford
@ 2021-08-26 17:42 ` Geert Uytterhoeven
2021-08-29 4:28 ` Stephen Boyd
2021-08-29 4:29 ` Stephen Boyd
1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-08-26 17:42 UTC (permalink / raw)
To: Adam Ford, Stephen Boyd, Michael Turquette
Cc: linux-clk, Dinghao Liu, Linux-Renesas
On Thu, Aug 26, 2021 at 4:17 PM Adam Ford <aford173@gmail.com> wrote:
> The probe was manually passing NULL instead of dev to devm_clk_hw_register.
> This caused a Unable to handle kernel NULL pointer dereference error.
> Fix this by passing 'dev'.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
Fixes: a20a40a8bbc2cf4b ("clk: renesas: rcar-usb2-clock-sel: Fix error
handling in .probe()")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Mike/Stephen: Can you please take this one directly, as we're
already at rc7.
Thanks!
> --- a/drivers/clk/renesas/rcar-usb2-clock-sel.c
> +++ b/drivers/clk/renesas/rcar-usb2-clock-sel.c
> @@ -187,7 +187,7 @@ static int rcar_usb2_clock_sel_probe(struct platform_device *pdev)
> init.ops = &usb2_clock_sel_clock_ops;
> priv->hw.init = &init;
>
> - ret = devm_clk_hw_register(NULL, &priv->hw);
> + ret = devm_clk_hw_register(dev, &priv->hw);
> if (ret)
> goto pm_put;
>
> --
> 2.25.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference
2021-08-26 17:42 ` Geert Uytterhoeven
@ 2021-08-29 4:28 ` Stephen Boyd
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2021-08-29 4:28 UTC (permalink / raw)
To: Adam Ford, Geert Uytterhoeven, Michael Turquette
Cc: linux-clk, Dinghao Liu, Linux-Renesas
Quoting Geert Uytterhoeven (2021-08-26 10:42:29)
> On Thu, Aug 26, 2021 at 4:17 PM Adam Ford <aford173@gmail.com> wrote:
> > The probe was manually passing NULL instead of dev to devm_clk_hw_register.
> > This caused a Unable to handle kernel NULL pointer dereference error.
> > Fix this by passing 'dev'.
> >
> > Signed-off-by: Adam Ford <aford173@gmail.com>
>
> Fixes: a20a40a8bbc2cf4b ("clk: renesas: rcar-usb2-clock-sel: Fix error
> handling in .probe()")
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Mike/Stephen: Can you please take this one directly, as we're
> already at rc7.
> Thanks!
>
It looks highly unlikely to make the cut but I'll try to send it off to
Linus tomorrow.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference
2021-08-26 14:17 [PATCH] clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference Adam Ford
2021-08-26 17:42 ` Geert Uytterhoeven
@ 2021-08-29 4:29 ` Stephen Boyd
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2021-08-29 4:29 UTC (permalink / raw)
To: Adam Ford, linux-clk; +Cc: geert+renesas, mturquette, Adam Ford
Quoting Adam Ford (2021-08-26 07:17:21)
> The probe was manually passing NULL instead of dev to devm_clk_hw_register.
> This caused a Unable to handle kernel NULL pointer dereference error.
> Fix this by passing 'dev'.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/drivers/clk/renesas/rcar-usb2-clock-sel.c b/drivers/clk/renesas/rcar-usb2-clock-sel.c
> index 9fb79bd79435..684d8937965e 100644
> --- a/drivers/clk/renesas/rcar-usb2-clock-sel.c
Applied to clk-fixes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-29 4:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 14:17 [PATCH] clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference Adam Ford
2021-08-26 17:42 ` Geert Uytterhoeven
2021-08-29 4:28 ` Stephen Boyd
2021-08-29 4:29 ` Stephen Boyd
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.