drm/i915: make hw page ioremap use ioremap_wc
[linux-2.6-block.git] / drivers / acpi / processor_core.c
index 34948362f41d0f820880b6ef723f783487b7e800..0cc2fd31e3765f7c9b945460345533dfebf1424b 100644 (file)
@@ -826,6 +826,11 @@ static int acpi_processor_add(struct acpi_device *device)
        if (!pr)
                return -ENOMEM;
 
+       if (!alloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) {
+               kfree(pr);
+               return -ENOMEM;
+       }
+
        pr->handle = device->handle;
        strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
@@ -845,10 +850,8 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
 
        pr = acpi_driver_data(device);
 
-       if (pr->id >= nr_cpu_ids) {
-               kfree(pr);
-               return 0;
-       }
+       if (pr->id >= nr_cpu_ids)
+               goto free;
 
        if (type == ACPI_BUS_REMOVAL_EJECT) {
                if (acpi_processor_handle_eject(pr))
@@ -873,6 +876,9 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
 
        per_cpu(processors, pr->id) = NULL;
        per_cpu(processor_device_array, pr->id) = NULL;
+
+free:
+       free_cpumask_var(pr->throttling.shared_cpu_map);
        kfree(pr);
 
        return 0;