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

Commit be6b935c authored by Asha Magadi Venkateshamurthy's avatar Asha Magadi Venkateshamurthy
Browse files

clk: qcom: rcg2: Fix possible null pointer dereference



The commit 966bfec0 ("clk: qcom: rcg2: set default freq
to clk_gfx3d_src") opens a possibility for NULL pointer
dereference, fix this.

Change-Id: I5053c3aec17e37656091dfe07af78269bcdab56e
Signed-off-by: default avatarAsha Magadi Venkateshamurthy <amagad@codeaurora.org>
parent 2a82a828
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1472,7 +1472,11 @@ static int clk_gfx3d_src_determine_rate(struct clk_hw *hw,
	}

	f = qcom_find_freq(rcg->freq_tbl, req->rate);
	if (!f || (req->rate != f->freq))

	if (!f)
		return -EINVAL;

	if (req->rate != f->freq)
		req->rate = f->freq;

	/* Indexes of source from the parent map */