aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid
diff options
context:
space:
mode:
authoradam radford <aradford@gmail.com>2011-02-24 23:55:56 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-28 12:42:36 -0500
commiteb1b12377376e43aae4be338ffbbc32931ca4d10 (patch)
treee89c0e44872ab4a95b5e0ff1f80d79d676ed638f /drivers/scsi/megaraid
parent183ce896d726fb987da589fa8e36fb7214a494cc (diff)
[SCSI] megaraid_sas: Fix failure gotos
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c17
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c6
2 files changed, 12 insertions, 11 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index b71caa3f44ea..c4ac4a5a075a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -3424,7 +3424,6 @@ fail_reply_queue:
3424 megasas_free_cmds(instance); 3424 megasas_free_cmds(instance);
3425 3425
3426fail_alloc_cmds: 3426fail_alloc_cmds:
3427 iounmap(instance->reg_set);
3428 return 1; 3427 return 1;
3429} 3428}
3430 3429
@@ -3494,7 +3493,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
3494 3493
3495 /* Get operational params, sge flags, send init cmd to controller */ 3494 /* Get operational params, sge flags, send init cmd to controller */
3496 if (instance->instancet->init_adapter(instance)) 3495 if (instance->instancet->init_adapter(instance))
3497 return -ENODEV; 3496 goto fail_init_adapter;
3498 3497
3499 printk(KERN_ERR "megasas: INIT adapter done\n"); 3498 printk(KERN_ERR "megasas: INIT adapter done\n");
3500 3499
@@ -3553,6 +3552,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
3553 MEGASAS_COMPLETION_TIMER_INTERVAL); 3552 MEGASAS_COMPLETION_TIMER_INTERVAL);
3554 return 0; 3553 return 0;
3555 3554
3555fail_init_adapter:
3556fail_ready_state: 3556fail_ready_state:
3557 iounmap(instance->reg_set); 3557 iounmap(instance->reg_set);
3558 3558
@@ -4105,10 +4105,13 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4105 instance->instancet->disable_intr(instance->reg_set); 4105 instance->instancet->disable_intr(instance->reg_set);
4106 free_irq(instance->msi_flag ? instance->msixentry.vector : 4106 free_irq(instance->msi_flag ? instance->msixentry.vector :
4107 instance->pdev->irq, instance); 4107 instance->pdev->irq, instance);
4108fail_irq:
4108 if (instance->msi_flag) 4109 if (instance->msi_flag)
4109 pci_disable_msix(instance->pdev); 4110 pci_disable_msix(instance->pdev);
4110 4111 if (instance->pdev->device == PCI_DEVICE_ID_LSI_FUSION)
4111 fail_irq: 4112 megasas_release_fusion(instance);
4113 else
4114 megasas_release_mfi(instance);
4112 fail_init_mfi: 4115 fail_init_mfi:
4113 fail_alloc_dma_buf: 4116 fail_alloc_dma_buf:
4114 if (instance->evt_detail) 4117 if (instance->evt_detail)
@@ -4116,13 +4119,9 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4116 instance->evt_detail, 4119 instance->evt_detail,
4117 instance->evt_detail_h); 4120 instance->evt_detail_h);
4118 4121
4119 if (instance->producer) { 4122 if (instance->producer)
4120 pci_free_consistent(pdev, sizeof(u32), instance->producer, 4123 pci_free_consistent(pdev, sizeof(u32), instance->producer,
4121 instance->producer_h); 4124 instance->producer_h);
4122 megasas_release_mfi(instance);
4123 } else {
4124 megasas_release_fusion(instance);
4125 }
4126 if (instance->consumer) 4125 if (instance->consumer)
4127 pci_free_consistent(pdev, sizeof(u32), instance->consumer, 4126 pci_free_consistent(pdev, sizeof(u32), instance->consumer,
4128 instance->consumer_h); 4127 instance->consumer_h);
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index c1e09d5a6196..26865290c22a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -984,13 +984,15 @@ megasas_init_adapter_fusion(struct megasas_instance *instance)
984 984
985 return 0; 985 return 0;
986 986
987fail_alloc_cmds:
988fail_alloc_mfi_cmds:
989fail_map_info: 987fail_map_info:
990 if (i == 1) 988 if (i == 1)
991 dma_free_coherent(&instance->pdev->dev, fusion->map_sz, 989 dma_free_coherent(&instance->pdev->dev, fusion->map_sz,
992 fusion->ld_map[0], fusion->ld_map_phys[0]); 990 fusion->ld_map[0], fusion->ld_map_phys[0]);
993fail_ioc_init: 991fail_ioc_init:
992 megasas_free_cmds_fusion(instance);
993fail_alloc_cmds:
994 megasas_free_cmds(instance);
995fail_alloc_mfi_cmds:
994 return 1; 996 return 1;
995} 997}
996 998