diff options
author | Zhang Rui <rui.zhang@intel.com> | 2014-01-01 22:57:48 -0500 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2014-01-01 22:59:18 -0500 |
commit | a116776f7b6052599df0c67db29c30ea9d69d7ee (patch) | |
tree | e83cd1cb0bfc10282477e516b83b7ece706ba0e0 | |
parent | 1c9573a40c1d34494419f32560f28c763c504d79 (diff) |
Thermal cpu cooling: return error if no valid cpu frequency entry
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
-rw-r--r-- | drivers/thermal/cpu_cooling.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index cc556a8e2842..bb486b4ca48e 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c | |||
@@ -173,6 +173,11 @@ static int get_property(unsigned int cpu, unsigned long input, | |||
173 | freq = table[i].frequency; | 173 | freq = table[i].frequency; |
174 | max_level++; | 174 | max_level++; |
175 | } | 175 | } |
176 | |||
177 | /* No valid cpu frequency entry */ | ||
178 | if (max_level == 0) | ||
179 | return -EINVAL; | ||
180 | |||
176 | /* max_level is an index, not a counter */ | 181 | /* max_level is an index, not a counter */ |
177 | max_level--; | 182 | max_level--; |
178 | 183 | ||