aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/processor_driver.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 8ae05ce18500..fce0066aa4a4 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -535,8 +535,8 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
535 return -ENOMEM; 535 return -ENOMEM;
536 536
537 if (!zalloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) { 537 if (!zalloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) {
538 kfree(pr); 538 result = -ENOMEM;
539 return -ENOMEM; 539 goto err_free_pr;
540 } 540 }
541 541
542 pr->handle = device->handle; 542 pr->handle = device->handle;
@@ -576,7 +576,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
576 dev = get_cpu_device(pr->id); 576 dev = get_cpu_device(pr->id);
577 if (sysfs_create_link(&device->dev.kobj, &dev->kobj, "sysdev")) { 577 if (sysfs_create_link(&device->dev.kobj, &dev->kobj, "sysdev")) {
578 result = -EFAULT; 578 result = -EFAULT;
579 goto err_free_cpumask; 579 goto err_clear_processor;
580 } 580 }
581 581
582 /* 582 /*
@@ -594,9 +594,15 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
594 594
595err_remove_sysfs: 595err_remove_sysfs:
596 sysfs_remove_link(&device->dev.kobj, "sysdev"); 596 sysfs_remove_link(&device->dev.kobj, "sysdev");
597err_clear_processor:
598 /*
599 * processor_device_array is not cleared to allow checks for buggy BIOS
600 */
601 per_cpu(processors, pr->id) = NULL;
597err_free_cpumask: 602err_free_cpumask:
598 free_cpumask_var(pr->throttling.shared_cpu_map); 603 free_cpumask_var(pr->throttling.shared_cpu_map);
599 604err_free_pr:
605 kfree(pr);
600 return result; 606 return result;
601} 607}
602 608