Skip to contentSkip to conversation

be2iscsi: Cleanup of load failure

PATCH In review Jayamohan Kallickal 1 participant 1 message Jun 30, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/12 be2iscsi: Cleanup of load failure

This patch reorganizes cleanup incase the driver failed during insmod

---
 drivers/scsi/be2iscsi/be_main.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/scsi/be2iscsi/be_main.c +4 -5
index 811a788..8f3e4b9 100644
@@ -3726,8 +3726,6 @@ static int beiscsi_task_xmit(struct iscsi_task *task)
 		SE_DEBUG(DBG_LVL_1, " scsi_dma_map Failed\n")
 		return num_sg;
 	}
-	SE_DEBUG(DBG_LVL_4, "xferlen=0x%08x scmd=%p num_sg=%d sernum=%lu\n",
-		  (scsi_bufflen(sc)), sc, num_sg, sc->serial_number);
 	xferlen = scsi_bufflen(sc);
 	sg = scsi_sglist(sc);
 	if (sc->sc_data_direction == DMA_TO_DEVICE) {
@@ -3961,10 +3959,10 @@ free_intr:
 			msix_vec = phba->msix_entries[i].vector;
 			free_irq(msix_vec, &phwi_context->be_eq[i]);
 		}
-	} else
+	} else {
 		if (phba->pcidev->irq)
 			free_irq(phba->pcidev->irq, phba);
-	pci_disable_msix(phba->pcidev);
+	}
 free_blkenbld:
 	destroy_workqueue(phba->wq);
 	if (blk_iopoll_enabled)
@@ -3984,13 +3982,14 @@ free_port:
 		value &= 0xfffeffff;
 		writel(value, (void *)real_offset);
 	}
-
 	pci_free_consistent(phba->pcidev,
 			    phba->ctrl.mbox_mem_alloced.size,
 			    phba->ctrl.mbox_mem_alloced.va,
 			   phba->ctrl.mbox_mem_alloced.dma);
 	beiscsi_unmap_pci_function(phba);
 hba_free:
+	if (phba->msix_enabled)
+		pci_disable_msix(phba->pcidev);
 	iscsi_host_remove(phba->shost);
 	pci_dev_put(phba->pcidev);
 	iscsi_host_free(phba->shost);
Signature · 1 line
1.6.5.2