diff options
author | Stanimir Varbanov <svarbanov@mm-sol.com> | 2015-01-05 11:04:23 -0500 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2015-01-17 14:33:57 -0500 |
commit | c7662fc59ca38517e0ec04ceaa123ed8209ab6bf (patch) | |
tree | 1558b888ae88613c645fdc15eecbe253492618d3 | |
parent | 176a107b868781c8d6868454aea7d07e0b82d6b8 (diff) |
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>
-rw-r--r-- | drivers/clk/clk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index f4963b7d4e17..d48ac71c6c8b 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
@@ -1366,7 +1366,7 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate) | |||
1366 | new_rate = clk->ops->determine_rate(clk->hw, rate, | 1366 | new_rate = clk->ops->determine_rate(clk->hw, rate, |
1367 | &best_parent_rate, | 1367 | &best_parent_rate, |
1368 | &parent_hw); | 1368 | &parent_hw); |
1369 | parent = parent_hw->clk; | 1369 | parent = parent_hw ? parent_hw->clk : NULL; |
1370 | } else if (clk->ops->round_rate) { | 1370 | } else if (clk->ops->round_rate) { |
1371 | new_rate = clk->ops->round_rate(clk->hw, rate, | 1371 | new_rate = clk->ops->round_rate(clk->hw, rate, |
1372 | &best_parent_rate); | 1372 | &best_parent_rate); |