aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst (Tixy) <tixy@linaro.org>2012-08-14 12:52:31 +0100
committerJon Medhurst <tixy@linaro.org>2012-08-15 10:34:25 +0100
commit19283c2be5d1960c408960caef117e093cc3c573 (patch)
tree7e8a38d997962aefa4e4bb39a43529e109cf0947
parentd000afe5dc7709d81dce47e0a8c4035d0fdc0d02 (diff)
When a kernel is built to support multiple hardware types it's possible that CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is set but the hardware the kernel is run on doesn't support cpuidle and therefore doesn't load a driver for it. In this case, when the system is shut down, cpuidle_coupled_cpu_notify() gets called with cpuidle_devices set to NULL. There are quite possibly other circumstances where this situation can also occur and we should check for it. Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--drivers/cpuidle/coupled.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
index 2c9bf269223..c78a5ff5c3c 100644
--- a/drivers/cpuidle/coupled.c
+++ b/drivers/cpuidle/coupled.c
@@ -681,7 +681,7 @@ static int cpuidle_coupled_cpu_notify(struct notifier_block *nb,
mutex_lock(&cpuidle_lock);
dev = per_cpu(cpuidle_devices, cpu);
- if (!dev->coupled)
+ if (!dev || !dev->coupled)
goto out;
switch (action & ~CPU_TASKS_FROZEN) {