diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-07 20:40:42 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-10-08 22:51:27 -0400 |
commit | e8b1b59dc8e42a47c4ce541bd1767ffac206b29c (patch) | |
tree | c64aaad7cb6a187a2acc9ec17c9984c05c120b5d /drivers/acpi | |
parent | f5a246eab9a268f51ba8189ea5b098a1bfff200e (diff) |
cpuidle / ACPI: fix potential NULL pointer dereference
The dereference should be moved below the NULL test.
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/processor_idle.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 3655ab923812..e8086c725305 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -1132,7 +1132,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) | |||
1132 | int acpi_processor_hotplug(struct acpi_processor *pr) | 1132 | int acpi_processor_hotplug(struct acpi_processor *pr) |
1133 | { | 1133 | { |
1134 | int ret = 0; | 1134 | int ret = 0; |
1135 | struct cpuidle_device *dev = per_cpu(acpi_cpuidle_device, pr->id); | 1135 | struct cpuidle_device *dev; |
1136 | 1136 | ||
1137 | if (disabled_by_idle_boot_param()) | 1137 | if (disabled_by_idle_boot_param()) |
1138 | return 0; | 1138 | return 0; |
@@ -1147,6 +1147,7 @@ int acpi_processor_hotplug(struct acpi_processor *pr) | |||
1147 | if (!pr->flags.power_setup_done) | 1147 | if (!pr->flags.power_setup_done) |
1148 | return -ENODEV; | 1148 | return -ENODEV; |
1149 | 1149 | ||
1150 | dev = per_cpu(acpi_cpuidle_device, pr->id); | ||
1150 | cpuidle_pause_and_lock(); | 1151 | cpuidle_pause_and_lock(); |
1151 | cpuidle_disable_device(dev); | 1152 | cpuidle_disable_device(dev); |
1152 | acpi_processor_get_power_info(pr); | 1153 | acpi_processor_get_power_info(pr); |