mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 05:32:00 +00:00
Thermal cpu cooling: return error if no valid cpu frequency entry
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
This commit is contained in:
parent
1c9573a40c
commit
a116776f7b
@ -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--;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user