Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e6f31c5 authored by Amit Nischal's avatar Amit Nischal
Browse files

clk: qcom: Fix null pointer exception



Add null pointer check before dereferencing pointers.

Change-Id: I9d96a3d0e7d00ffc2c2eb83a0d2384a21fe994ae
Signed-off-by: default avatarAmit Nischal <anischal@codeaurora.org>
parent 783427f7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);