Skip to contentSkip to conversation

Fix the bug in duplicate freq elimination code in acpi-cpufreq

PATCH New Venkatesh Pallipadi 1 participant 1 message Nov 14, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix the bug in duplicate freq elimination code in acpi-cpufreq

Fix the bug in duplicate states elimination in acpi-cpufreq.

Bug: Due to duplicate state elimiation in the loop earlier, the number of valid_states can be less than perf->state_count, in which case freq_table was ending up with some garbage/uninitialized entries in the table.

From: Alexey Starikovskiy <[email protected]>

---

 arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +1 -1
index 60d20cf..18f4715 100644
@@ -693,7 +693,7 @@ #endif
 		    perf->states[i].core_frequency * 1000;
 		valid_states++;
 	}
-	data->freq_table[perf->state_count].frequency = CPUFREQ_TABLE_END;
+	data->freq_table[valid_states].frequency = CPUFREQ_TABLE_END;
 
 	result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table);
 	if (result)