clk: qcom: Fix null pointer exception
Add null pointer check before dereferencing pointers. Change-Id: I9d96a3d0e7d00ffc2c2eb83a0d2384a21fe994ae Signed-off-by: Amit Nischal <anischal@codeaurora.org>
This commit is contained in:
parent
783427f7ad
commit
3e6f31c583
1 changed files with 3 additions and 0 deletions
|
@ -580,6 +580,9 @@ static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate)
|
|||
rcg->curr_index = 0;
|
||||
else {
|
||||
f = qcom_find_freq(rcg->freq_tbl, rcg->current_freq);
|
||||
if (!f)
|
||||
return -EINVAL;
|
||||
|
||||
rcg->curr_index = qcom_find_src_index(hw,
|
||||
rcg->parent_map, f->src);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue