aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/fan.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-04-08 12:31:56 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-04-08 12:31:56 +0200
commit0f0c8aa0d0562954cdfa135efb827067de7ba855 (patch)
treef1825e060e5b51374ee79388b47be662c9a0b297 /drivers/acpi/fan.c
parent077f893bd942b23d8e27c90f8f60018ce21010a0 (diff)
parent545d6e189a41c94c11f55045a771118eccc9d9eb (diff)
Merge branch 'acpi-assorted' into linux-next
* acpi-assorted: PCI / ACPI: Don't query OSC support with all possible controls ACPI / processor_thermal: avoid null pointer deference error ACPI / fan: avoid null pointer deference error ACPI / video: Fix applying indexed initial brightness value. ACPI / video: Make logic a little easier to understand. ACPI / video: Fix brightness control initialization for some laptops. ACPI: Use resource_size() in osl.c ACPI / acpi_pad: Used PTR_RET ACPI: suppress compiler warning in container.c ACPI: suppress compiler warning in battery.c ACPI: suppress compiler warnings in processor_throttling.c ACPI: suppress compiler warnings in button.c ACPI: replace kmalloc+memcpy with kmemdup ACPI: Remove acpi_pci_bind_root() definition ACPI video: ignore BIOS backlight value for HP dm4
Diffstat (limited to 'drivers/acpi/fan.c')
-rw-r--r--drivers/acpi/fan.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index f815da82c76..8d1c0105e11 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -174,9 +174,13 @@ static int acpi_fan_add(struct acpi_device *device)
static int acpi_fan_remove(struct acpi_device *device)
{
- struct thermal_cooling_device *cdev = acpi_driver_data(device);
+ struct thermal_cooling_device *cdev;
+
+ if (!device)
+ return -EINVAL;
- if (!device || !cdev)
+ cdev = acpi_driver_data(device);
+ if (!cdev)
return -EINVAL;
sysfs_remove_link(&device->dev.kobj, "thermal_cooling");