projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c9573a
)
Thermal cpu cooling: return error if no valid cpu frequency entry
author
Zhang Rui
<rui.zhang@intel.com>
Thu, 2 Jan 2014 03:57:48 +0000
(11:57 +0800)
committer
Zhang Rui
<rui.zhang@intel.com>
Thu, 2 Jan 2014 03:59:18 +0000
(11:59 +0800)
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/cpu_cooling.c
patch
|
blob
|
history
diff --git
a/drivers/thermal/cpu_cooling.c
b/drivers/thermal/cpu_cooling.c
index cc556a8e28427a336b90b3809406476da9f3e280..bb486b4ca48ec5cb3c914e8efcee16f37e24a75a 100644
(file)
--- 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,
freq = table[i].frequency;
max_level++;
}
+
+ /* No valid cpu frequency entry */
+ if (max_level == 0)
+ return -EINVAL;
+
/* max_level is an index, not a counter */
max_level--;