From 521caf641e76b48016e25b66e37799a9333ede39 Mon Sep 17 00:00:00 2001 From: Jon Medhurst Date: Wed, 19 Jun 2013 10:17:00 +0100 Subject: [PATCH] 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 --- arch/arm/mach-vexpress/tc2_pm_psci.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.34.1