aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_main.c
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@serverengines.com>2010-07-21 18:53:55 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:05:32 -0400
commit4f5af07e1bc4ae64b7a7ead5bf60f40a3115ceeb (patch)
tree9e37f902315be640c8ef4b6079c8f1ef3f482ee1 /drivers/scsi/be2iscsi/be_main.c
parent238f6b7255c68d2774795c97b32701c09fd1e543 (diff)
[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>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.c')
-rw-r--r--drivers/scsi/be2iscsi/be_main.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 26ac049c0c8..67a7e3f7bae 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)
616 struct pci_dev *pcidev = phba->pcidev; 616 struct pci_dev *pcidev = phba->pcidev;
617 struct hwi_controller *phwi_ctrlr; 617 struct hwi_controller *phwi_ctrlr;
618 struct hwi_context_memory *phwi_context; 618 struct hwi_context_memory *phwi_context;
619 int ret, msix_vec, i = 0; 619 int ret, msix_vec, i, j;
620 char desc[32]; 620 char desc[32];
621 621
622 phwi_ctrlr = phba->phwi_ctrlr; 622 phwi_ctrlr = phba->phwi_ctrlr;
@@ -628,10 +628,25 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
628 msix_vec = phba->msix_entries[i].vector; 628 msix_vec = phba->msix_entries[i].vector;
629 ret = request_irq(msix_vec, be_isr_msix, 0, desc, 629 ret = request_irq(msix_vec, be_isr_msix, 0, desc,
630 &phwi_context->be_eq[i]); 630 &phwi_context->be_eq[i]);
631 if (ret) {
632 shost_printk(KERN_ERR, phba->shost,
633 "beiscsi_init_irqs-Failed to"
634 "register msix for i = %d\n", i);
635 if (!i)
636 return ret;
637 goto free_msix_irqs;
638 }
631 } 639 }
632 msix_vec = phba->msix_entries[i].vector; 640 msix_vec = phba->msix_entries[i].vector;
633 ret = request_irq(msix_vec, be_isr_mcc, 0, "beiscsi_msix_mcc", 641 ret = request_irq(msix_vec, be_isr_mcc, 0, "beiscsi_msix_mcc",
634 &phwi_context->be_eq[i]); 642 &phwi_context->be_eq[i]);
643 if (ret) {
644 shost_printk(KERN_ERR, phba->shost, "beiscsi_init_irqs-"
645 "Failed to register beiscsi_msix_mcc\n");
646 i++;
647 goto free_msix_irqs;
648 }
649
635 } else { 650 } else {
636 ret = request_irq(pcidev->irq, be_isr, IRQF_SHARED, 651 ret = request_irq(pcidev->irq, be_isr, IRQF_SHARED,
637 "beiscsi", phba); 652 "beiscsi", phba);
@@ -642,6 +657,10 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
642 } 657 }
643 } 658 }
644 return 0; 659 return 0;
660free_msix_irqs:
661 for (j = i - 1; j == 0; j++)
662 free_irq(msix_vec, &phwi_context->be_eq[j]);
663 return ret;
645} 664}
646 665
647static void hwi_ring_cq_db(struct beiscsi_hba *phba, 666static void hwi_ring_cq_db(struct beiscsi_hba *phba,