mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 14:32:23 +00:00
clk: fix possible null pointer dereference
The commit 646cafc6
(clk: Change clk_ops->determine_rate to
return a clk_hw as the best parent) opens a possibility for
null pointer dereference, fix this.
Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
This commit is contained in:
parent
176a107b86
commit
c7662fc59c
@ -1366,7 +1366,7 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate)
|
||||
new_rate = clk->ops->determine_rate(clk->hw, rate,
|
||||
&best_parent_rate,
|
||||
&parent_hw);
|
||||
parent = parent_hw->clk;
|
||||
parent = parent_hw ? parent_hw->clk : NULL;
|
||||
} else if (clk->ops->round_rate) {
|
||||
new_rate = clk->ops->round_rate(clk->hw, rate,
|
||||
&best_parent_rate);
|
||||
|
Loading…
Reference in New Issue
Block a user