aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2013-06-19 10:17:00 +0100
committerJon Medhurst <tixy@linaro.org>2013-07-01 11:05:16 +0100
commit521caf641e76b48016e25b66e37799a9333ede39 (patch)
treedf12bf3f6b823a7eb26167aa487b8692243cb53a
parentb62c31f5262bdba8171287cfe92df7bdeed1af31 (diff)
ARM: vexpress: Ensure SPC driver is loaded before using it in PSCI init
Otherwise we get a nullptr dereference calling vexpress_spc_get_nb_cpus. Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--arch/arm/mach-vexpress/tc2_pm_psci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/mach-vexpress/tc2_pm_psci.c b/arch/arm/mach-vexpress/tc2_pm_psci.c
index 5a5e4f568497..c2fdc22e4c06 100644
--- a/arch/arm/mach-vexpress/tc2_pm_psci.c
+++ b/arch/arm/mach-vexpress/tc2_pm_psci.c
@@ -155,6 +155,11 @@ static int __init tc2_pm_psci_init(void)
return -ENODEV;
}
+ if (!vexpress_spc_check_loaded()) {
+ pr_debug("spc not found. Aborting psci init\n");
+ return -ENODEV;
+ }
+
tc2_pm_usage_count_init();
ret = mcpm_platform_register(&tc2_pm_power_ops);