Commit a116776f authored by Zhang Rui's avatar Zhang Rui

Thermal cpu cooling: return error if no valid cpu frequency entry

Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 1c9573a4
...@@ -173,6 +173,11 @@ static int get_property(unsigned int cpu, unsigned long input, ...@@ -173,6 +173,11 @@ static int get_property(unsigned int cpu, unsigned long input,
freq = table[i].frequency; freq = table[i].frequency;
max_level++; max_level++;
} }
/* No valid cpu frequency entry */
if (max_level == 0)
return -EINVAL;
/* max_level is an index, not a counter */ /* max_level is an index, not a counter */
max_level--; max_level--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment