diff options
author | Junjie Wu <junjiew@codeaurora.org> | 2015-08-27 12:46:14 -0700 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:03:00 -0700 |
commit | 79d8f58e5e788239ff15a4acd0b7ff166f103bd6 (patch) | |
tree | 4f807fd14f008ebb755ffde912214a512bc9ba77 /drivers/cpufreq/qcom-cpufreq.c | |
parent | 1a7d6caef616f6ad46ecf3b9548464e6972a3bea (diff) |
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: Junjie Wu <junjiew@codeaurora.org>
Diffstat (limited to 'drivers/cpufreq/qcom-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/qcom-cpufreq.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/cpufreq/qcom-cpufreq.c b/drivers/cpufreq/qcom-cpufreq.c index 09f10647982b..465198f34903 100644 --- a/drivers/cpufreq/qcom-cpufreq.c +++ b/drivers/cpufreq/qcom-cpufreq.c @@ -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); |