aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFenghua Yu <fenghua.yu@intel.com>2007-07-31 03:37:26 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 18:39:36 -0400
commit45c876bf12b431afa9c438b24bd6f55f3a815805 (patch)
treee8a6b2d3210d425d399de08dcdff45e74080b7db
parent7f8e00f2b9797ce7235634431d65269d21ef80d2 (diff)
Fix uninitialized local variable "covered" in i386 acpi-cpufreq driver
The local variable "covered" is used without initialization in i386 acpi-cpufreq driver. The initial value of covered should be 0. The bug will cause memory leak when hit. The following patch fixes this bug. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 6f846bee2103..32d04b083e38 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -511,7 +511,6 @@ acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
511static int acpi_cpufreq_early_init(void) 511static int acpi_cpufreq_early_init(void)
512{ 512{
513 struct acpi_processor_performance *data; 513 struct acpi_processor_performance *data;
514 cpumask_t covered;
515 unsigned int i, j; 514 unsigned int i, j;
516 515
517 dprintk("acpi_cpufreq_early_init\n"); 516 dprintk("acpi_cpufreq_early_init\n");
@@ -520,14 +519,13 @@ static int acpi_cpufreq_early_init(void)
520 data = kzalloc(sizeof(struct acpi_processor_performance), 519 data = kzalloc(sizeof(struct acpi_processor_performance),
521 GFP_KERNEL); 520 GFP_KERNEL);
522 if (!data) { 521 if (!data) {
523 for_each_cpu_mask(j, covered) { 522 for_each_possible_cpu(j) {
524 kfree(acpi_perf_data[j]); 523 kfree(acpi_perf_data[j]);
525 acpi_perf_data[j] = NULL; 524 acpi_perf_data[j] = NULL;
526 } 525 }
527 return -ENOMEM; 526 return -ENOMEM;
528 } 527 }
529 acpi_perf_data[i] = data; 528 acpi_perf_data[i] = data;
530 cpu_set(i, covered);
531 } 529 }
532 530
533 /* Do initialization in ACPI core */ 531 /* Do initialization in ACPI core */