From: Jon Medhurst Date: Wed, 19 Jun 2013 09:17:00 +0000 (+0100) Subject: ARM: vexpress: Ensure SPC driver is loaded before using it in PSCI init X-Git-Tag: firefly_0821_release~3680^2~236^2^2~1^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=521caf641e76b48016e25b66e37799a9333ede39;p=firefly-linux-kernel-4.4.55.git 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 --- 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);