Skip to content

Commit

Permalink
[SCSI] qla4xxx: Fix panic while rmmod
Browse files Browse the repository at this point in the history
Issue:
System panic on rmmod if probe_adapter had failed during driver load.

Call Trace:
 [<ffffffffa071aa5a>] qla4xxx_abort_active_cmds+0x4a/0xa0 [qla4xxx]
 [<ffffffffa07224db>] qla4xxx_free_adapter+0x1b/0x1b0 [qla4xxx]
 [<ffffffffa073991f>] qla4xxx_remove_adapter+0x294/0x2c7 [qla4xxx]
 [<ffffffff812930b7>] pci_device_remove+0x37/0x70
 [<ffffffff8135006f>] __device_release_driver+0x6f/0xe0
 [<ffffffff813501a8>] driver_detach+0xc8/0xd0
 [<ffffffff8134ef0e>] bus_remove_driver+0x8e/0x110
 [<ffffffff81350972>] driver_unregister+0x62/0xa0
 [<ffffffff812933c4>] pci_unregister_driver+0x44/0xb0
 [<ffffffffa0739659>] qla4xxx_module_exit+0x15/0x47 [qla4xxx]
 [<ffffffff810addd4>] sys_delete_module+0x194/0x260
 [<ffffffff8150326e>] ? do_page_fault+0x3e/0xa0
 [<ffffffff8100b0f2>] system_call_fastpath+0x16/0x1b

Fix:
Do not cleanup resources on remove_adapter as they are cleaned up during
probe_adapter exit.

Signed-off-by: Vikas Chaudhary <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
Vikas Chaudhary authored and James Bottomley committed Sep 24, 2012
1 parent 7977f82 commit f8b0751
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/scsi/qla4xxx/ql4_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -5449,6 +5449,13 @@ static void __devexit qla4xxx_remove_adapter(struct pci_dev *pdev)
{
struct scsi_qla_host *ha;

/*
* If the PCI device is disabled then it means probe_adapter had
* failed and resources already cleaned up on probe_adapter exit.
*/
if (!pci_is_enabled(pdev))
return;

ha = pci_get_drvdata(pdev);

if (is_qla40XX(ha))
Expand Down

0 comments on commit f8b0751

Please sign in to comment.