Skip to content

Commit

Permalink
clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference
Browse files Browse the repository at this point in the history
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: a20a40a ("clk: renesas: rcar-usb2-clock-sel: Fix error handling in .probe()")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Adam Ford authored and Stephen Boyd committed Aug 29, 2021
1 parent 9711759 commit 1669a94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/renesas/rcar-usb2-clock-sel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1669a94

Please sign in to comment.