|
@@ -809,10 +809,12 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
|
|
|
|
|
|
acpi_processor_remove_fs(device);
|
|
|
|
|
|
- sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
|
|
|
- sysfs_remove_link(&pr->cdev->device.kobj, "device");
|
|
|
- thermal_cooling_device_unregister(pr->cdev);
|
|
|
- pr->cdev = NULL;
|
|
|
+ if (pr->cdev) {
|
|
|
+ sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
|
|
|
+ sysfs_remove_link(&pr->cdev->device.kobj, "device");
|
|
|
+ thermal_cooling_device_unregister(pr->cdev);
|
|
|
+ pr->cdev = NULL;
|
|
|
+ }
|
|
|
|
|
|
processors[pr->id] = NULL;
|
|
|
|