diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-02-25 03:59:44 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-02-28 19:39:30 -0500 |
commit | bd0fa9bb455d9b58ec2d7a36cd08afed9e3411b4 (patch) | |
tree | 450e9eac17b1d86c277ae27e20d5972147ad5b8f /drivers/cpufreq/cpufreq.c | |
parent | 52e7e816420383a340cfb6c3ffd12477c3c80b76 (diff) |
cpufreq: Return error if ->get() failed in cpufreq_update_policy()
cpufreq_update_policy() calls cpufreq_driver->get() to get current
frequency of a CPU and it is not supposed to fail or return zero.
Return error in case that happens.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 5815af50d3de..56b7b1be352d 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -2139,6 +2139,11 @@ int cpufreq_update_policy(unsigned int cpu) | |||
2139 | */ | 2139 | */ |
2140 | if (cpufreq_driver->get) { | 2140 | if (cpufreq_driver->get) { |
2141 | new_policy.cur = cpufreq_driver->get(cpu); | 2141 | new_policy.cur = cpufreq_driver->get(cpu); |
2142 | if (WARN_ON(!new_policy.cur)) { | ||
2143 | ret = -EIO; | ||
2144 | goto no_policy; | ||
2145 | } | ||
2146 | |||
2142 | if (!policy->cur) { | 2147 | if (!policy->cur) { |
2143 | pr_debug("Driver did not initialize current freq"); | 2148 | pr_debug("Driver did not initialize current freq"); |
2144 | policy->cur = new_policy.cur; | 2149 | policy->cur = new_policy.cur; |