Skip to content

Commit

Permalink
drivers: clk: assert registered clock pointer is not NULL
Browse files Browse the repository at this point in the history
Fix clk_register() assertion entry instruction to print an assertion
error message on NULL clock pointer instead of issuing a segmentation
fault.

Fixes: 2305544 ("drivers: clk: add generic clock framework")
Signed-off-by: Etienne Carriere <[email protected]>
  • Loading branch information
etienne-lms committed Nov 26, 2023
1 parent b5274f3 commit 8f8159d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void clk_free(struct clk *clk)

static bool __maybe_unused clk_check(struct clk *clk)
{
if (!clk->ops)
if (!clk || !clk->ops)
return false;

if (clk->ops->set_parent && !clk->ops->get_parent)
Expand Down

0 comments on commit 8f8159d

Please sign in to comment.