提交 3d4a7ef3 编写于 作者: V Venkatesh Pallipadi 提交者: Dave Jones

[CPUFREQ] 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.
Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
From:  Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: NDave Jones <davej@redhat.com>
上级 8b9c6671
......@@ -693,7 +693,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册