[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e8b1b59dc8e42a47c4ce541bd1767ffac206b29c.1349761836.git.len.brown@intel.com>
Date: Tue, 9 Oct 2012 01:54:18 -0400
From: Len Brown <lenb@...nel.org>
To: linux-acpi@...r.kernel.org, linux-pm@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
Len Brown <len.brown@...el.com>
Subject: [PATCH 28/30] cpuidle / ACPI: fix potential NULL pointer dereference
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
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@...ndmicro.com.cn>
Signed-off-by: Len Brown <len.brown@...el.com>
---
drivers/acpi/processor_idle.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 3655ab9..e8086c7 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)
int acpi_processor_hotplug(struct acpi_processor *pr)
{
int ret = 0;
- struct cpuidle_device *dev = per_cpu(acpi_cpuidle_device, pr->id);
+ struct cpuidle_device *dev;
if (disabled_by_idle_boot_param())
return 0;
@@ -1147,6 +1147,7 @@ int acpi_processor_hotplug(struct acpi_processor *pr)
if (!pr->flags.power_setup_done)
return -ENODEV;
+ dev = per_cpu(acpi_cpuidle_device, pr->id);
cpuidle_pause_and_lock();
cpuidle_disable_device(dev);
acpi_processor_get_power_info(pr);
--
1.8.0.rc1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists