• Meelis Roos's avatar
    scsi: aacraid: Fix driver oops with dead battery · bef4e688
    Meelis Roos authored
    The battery in my HP NetRAID-4M died of old age, and the aacraid driver
    started oopsing with NULL pointer dereference on startup after that.
    
    Fix it by reordering the init sequence to fill in function pointers
    before ioremapping memory, or dev->a_ops.adapter_ioremap pointer will be
    NULL.
    
    Other subtypes of aacraid seem to have the order already correct.
    
    This was the call trace:
    
     ? aac_probe_one+0x7a5/0xb30 [aacraid]
     pci_device_probe+0xc0/0x1a0
     driver_probe_device+0x1df/0x3b0
     __driver_attach+0xa9/0xe0
     ? driver_probe_device+0x3b0/0x3b0
     bus_for_each_dev+0x4c/0x90
     driver_attach+0x1d/0x40
     ? driver_probe_device+0x3b0/0x3b0
     bus_add_driver+0x1a7/0x2a0
     driver_register+0x6e/0x130
     __pci_register_driver+0x54/0x90
     ? 0xf81f4000
     aac_init+0x2b/0x1000 [aacraid]
     do_one_initcall+0x45/0x1e0
     ? kfree_skbmem+0x74/0xa0
     ? kfree+0x16d/0x240
     ? kvfree+0x45/0x50
     ? kvfree+0x45/0x50
     ? __vunmap+0x99/0x120
     ? do_init_module+0x1a/0x245
     do_init_module+0x83/0x245
     load_module+0x2764/0x34a0
     ? kernel_read_file+0x150/0x320
     SyS_finit_module+0x82/0xa0
     do_fast_syscall_32+0xba/0x340
    Signed-off-by: default avatarMeelis Roos <mroos@linux.ee>
    Reviewed-by: default avatarRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    bef4e688
sa.c 10.2 KB