[SCSI] ipr: dlpar failed when adding an adapter back
authorwenxiong@linux.vnet.ibm.com <wenxiong@linux.vnet.ibm.com>
Thu, 14 Mar 2013 18:52:24 +0000 (13:52 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Sat, 6 Apr 2013 10:25:37 +0000 (11:25 +0100)
Reinitialize resource queue prior to freeing resource entries to ensure they
are not referenced. This fixes an issue with target_destoy accessing memory
after it was freed.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/ipr.c

index 21e0a0ae43a826f9a7b64cb3d1f398c90dc3102e..2197b57fb2251f541e0bfc0eab626ce670b66504 100644 (file)
@@ -9728,6 +9728,7 @@ static void __ipr_remove(struct pci_dev *pdev)
        spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
        wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
        flush_work(&ioa_cfg->work_q);
+       INIT_LIST_HEAD(&ioa_cfg->used_res_q);
        spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags);
 
        spin_lock(&ipr_driver_lock);