# Re: crash in init\_ipic\_sysfs on efika

- From: Kumar Gala \<hidden\>
- Date: 2008-03-20 15:16:00 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2008/03/9437029
- Thread: https://ratatoskr.run/linuxppc-dev/2008/03/9436880/t.md

```text

On Mar 17, 2008, at 2:53 PM, Olaf Hering wrote:
>
> I cant reproduce this bug on my board, but:
>
> The global primary_ipic in arch/powerpc/sysdev/ipic.c can remain NULL if
> ipic_init() fails. init_ipic_sysfs() will crash in that case.
>
> Something like this may fix it:
>
> Index: linux-2.6.25-rc6/arch/powerpc/sysdev/ipic.c
> ===================================================================
> --- linux-2.6.25-rc6.orig/arch/powerpc/sysdev/ipic.c
> +++ linux-2.6.25-rc6/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");

We should look and see if we can change init_ipic_sysfs() from a subsys_initcall() to just getting called at the end of ipic_init().

- k
```
