diff options
author | Zhang Rui <rui.zhang@intel.com> | 2015-01-04 09:35:59 +0100 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2015-01-06 01:18:21 +0100 |
commit | ad0f409051a67dde8d454990e09b6db41f675876 (patch) | |
tree | b79ff6772c54d2c7f3955a88e639b461c4176199 /drivers/thermal/int340x_thermal | |
parent | ACPI/int340x_thermal: enumerate INT3401 for Intel SoC DTS thermal driver (diff) | |
download | linux-ad0f409051a67dde8d454990e09b6db41f675876.tar.xz linux-ad0f409051a67dde8d454990e09b6db41f675876.zip |
int340x_thermal/processor_thermal_device: return failure when
there is no ACPI device object
processor_thermal_device driver needs ACPI support to work. Thus, the driver
probing should fail when there is no ACPI device object asscociated.
This fixes a NULL pointer dereference when the driver is loaded
with INT340X feature disabled in BIOS.
Reported-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Diffstat (limited to 'drivers/thermal/int340x_thermal')
-rw-r--r-- | drivers/thermal/int340x_thermal/processor_thermal_device.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/thermal/int340x_thermal/processor_thermal_device.c b/drivers/thermal/int340x_thermal/processor_thermal_device.c index 31bb553aac26..0fe5dbbea968 100644 --- a/drivers/thermal/int340x_thermal/processor_thermal_device.c +++ b/drivers/thermal/int340x_thermal/processor_thermal_device.c @@ -130,6 +130,8 @@ static int proc_thermal_add(struct device *dev, int ret; adev = ACPI_COMPANION(dev); + if (!adev) + return -ENODEV; status = acpi_evaluate_object(adev->handle, "PPCC", NULL, &buf); if (ACPI_FAILURE(status)) |