diff options
author | Jon Medhurst (Tixy) <tixy@linaro.org> | 2012-08-14 12:52:31 +0100 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2012-08-15 10:34:25 +0100 |
commit | 19283c2be5d1960c408960caef117e093cc3c573 (patch) | |
tree | 7e8a38d997962aefa4e4bb39a43529e109cf0947 | |
parent | d000afe5dc7709d81dce47e0a8c4035d0fdc0d02 (diff) |
cpuidle: Prevent null pointer dereference in cpuidle_coupled_cpu_notifytracking-tracking-armlt-misc-fixes-ll-20120820.0tracking-tracking-armlt-misc-fixes-ll-20120817.2tracking-tracking-armlt-misc-fixes-ll-20120817.1tracking-tracking-armlt-misc-fixes-ll-20120817.0tracking-tracking-armlt-misc-fixes-ll-20120815.0
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c index 2c9bf2692232..c78a5ff5c3c5 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) { |