diff options
author | Jayamohan Kallickal <jayamohank@serverengines.com> | 2010-07-22 04:23:55 +0530 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 09:05:32 -0500 |
commit | 4f5af07e1bc4ae64b7a7ead5bf60f40a3115ceeb (patch) | |
tree | 9e37f902315be640c8ef4b6079c8f1ef3f482ee1 | |
parent | 238f6b7255c68d2774795c97b32701c09fd1e543 (diff) | |
download | linux-4f5af07e1bc4ae64b7a7ead5bf60f40a3115ceeb.tar.bz2 |
[SCSI] be2iscsi: Fix to handle request_irq failure
This patch handles request_irq failures by properly cleaning up
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 26ac049c0c85..67a7e3f7bae6 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -616,7 +616,7 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba) struct pci_dev *pcidev = phba->pcidev; struct hwi_controller *phwi_ctrlr; struct hwi_context_memory *phwi_context; - int ret, msix_vec, i = 0; + int ret, msix_vec, i, j; char desc[32]; phwi_ctrlr = phba->phwi_ctrlr; @@ -628,10 +628,25 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba) msix_vec = phba->msix_entries[i].vector; ret = request_irq(msix_vec, be_isr_msix, 0, desc, &phwi_context->be_eq[i]); + if (ret) { + shost_printk(KERN_ERR, phba->shost, + "beiscsi_init_irqs-Failed to" + "register msix for i = %d\n", i); + if (!i) + return ret; + goto free_msix_irqs; + } } msix_vec = phba->msix_entries[i].vector; ret = request_irq(msix_vec, be_isr_mcc, 0, "beiscsi_msix_mcc", &phwi_context->be_eq[i]); + if (ret) { + shost_printk(KERN_ERR, phba->shost, "beiscsi_init_irqs-" + "Failed to register beiscsi_msix_mcc\n"); + i++; + goto free_msix_irqs; + } + } else { ret = request_irq(pcidev->irq, be_isr, IRQF_SHARED, "beiscsi", phba); @@ -642,6 +657,10 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba) } } return 0; +free_msix_irqs: + for (j = i - 1; j == 0; j++) + free_irq(msix_vec, &phwi_context->be_eq[j]); + return ret; } static void hwi_ring_cq_db(struct beiscsi_hba *phba, |