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

Commit ef1c914c authored by Junjie Wu's avatar Junjie Wu
Browse files

cpufreq: qcom-cpufreq: Check return of cpufreq_frequency_get_table



cpufreq_frequency_get_table could return NULL. Do error check on the
return value instead of continue with a potentially NULL pointer.

Change-Id: I0cb8a3a8ae3499e738683e5f45271aeadee488f6
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent 0600f6c1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -88,6 +88,12 @@ static int msm_cpufreq_target(struct cpufreq_policy *policy,
	}

	table = cpufreq_frequency_get_table(policy->cpu);
	if (!table) {
		pr_err("cpufreq: Failed to get frequency table for CPU%u\n",
		       policy->cpu);
		ret = -ENODEV;
		goto done;
	}
	if (cpufreq_frequency_table_target(policy, table, target_freq, relation,
			&index)) {
		pr_err("cpufreq: invalid target_freq: %d\n", target_freq);