diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index a294921be650e4845d87599c108ede85079c22e5..4b9be532cb14a8abf6cf525b4cda0bde64b4bb06 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -142,14 +142,13 @@ static int get_property(unsigned int cpu, unsigned long input, int descend = -1; struct cpufreq_frequency_table *table = cpufreq_frequency_get_table(cpu); - + if (!output) return -EINVAL; if (!table) return -EINVAL; - for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) { /* ignore invalid entries */ if (table[i].frequency == CPUFREQ_ENTRY_INVALID)