From: Olaf Hering Date: Mon, 17 Mar 2008 19:53:05 +0000 (+1100) Subject: [POWERPC] Fix crash in init_ipic_sysfs on efika X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1428a9fa586cb80acf98289f797f58b8bd662598;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [POWERPC] Fix crash in init_ipic_sysfs on efika The global primary_ipic in arch/powerpc/sysdev/ipic.c can remain NULL if ipic_init() fails, which will happen on machines that don't have an ipic interrupt controller. init_ipic_sysfs() will crash in that case. Acked-by: Grant Likely Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index ae0dbf4c1d6..0f2dfb0aaa6 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c @@ -906,7 +906,7 @@ static int __init init_ipic_sysfs(void) { int rc; - if (!primary_ipic->regs) + if (!primary_ipic || !primary_ipic->regs) return -ENODEV; printk(KERN_DEBUG "Registering ipic with sysfs...\n");