diff --git a/[refs] b/[refs] index 9f8ce24c5999..d5d2fea9cab0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f0c29583db51104a7bc223b1e9c88d818f24ba4d +refs/heads/master: 99aa36386351488d12ad5d302e096a77f22705d9 diff --git a/trunk/drivers/acpi/processor_thermal.c b/trunk/drivers/acpi/processor_thermal.c index 641b5450a0db..e8e652710e65 100644 --- a/trunk/drivers/acpi/processor_thermal.c +++ b/trunk/drivers/acpi/processor_thermal.c @@ -218,9 +218,13 @@ processor_get_max_state(struct thermal_cooling_device *cdev, unsigned long *state) { struct acpi_device *device = cdev->devdata; - struct acpi_processor *pr = acpi_driver_data(device); + struct acpi_processor *pr; - if (!device || !pr) + if (!device) + return -EINVAL; + + pr = acpi_driver_data(device); + if (!pr) return -EINVAL; *state = acpi_processor_max_state(pr); @@ -232,9 +236,13 @@ processor_get_cur_state(struct thermal_cooling_device *cdev, unsigned long *cur_state) { struct acpi_device *device = cdev->devdata; - struct acpi_processor *pr = acpi_driver_data(device); + struct acpi_processor *pr; - if (!device || !pr) + if (!device) + return -EINVAL; + + pr = acpi_driver_data(device); + if (!pr) return -EINVAL; *cur_state = cpufreq_get_cur_state(pr->id); @@ -248,11 +256,15 @@ processor_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) { struct acpi_device *device = cdev->devdata; - struct acpi_processor *pr = acpi_driver_data(device); + struct acpi_processor *pr; int result = 0; int max_pstate; - if (!device || !pr) + if (!device) + return -EINVAL; + + pr = acpi_driver_data(device); + if (!pr) return -EINVAL; max_pstate = cpufreq_get_max_state(pr->id);