[POWERPC] Fix crash in init_ipic_sysfs on efika
authorOlaf Hering <olaf@aepfle.de>
Mon, 17 Mar 2008 19:53:05 +0000 (06:53 +1100)
committerPaul Mackerras <paulus@samba.org>
Mon, 24 Mar 2008 06:55:00 +0000 (17:55 +1100)
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 <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/sysdev/ipic.c

index ae0dbf4c1d66499b6b64f8f31f7b711062ca13ea..0f2dfb0aaa6adaa77e6e1232d1951a4fe3d7382d 100644 (file)
@@ -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");