[PATCH 1/15] megaraid_sas: Fix failure gotos

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



James/Linux-scsi,

This patch fixes some failure gotos in megaraid_sas.

Signed-off-by: Adam Radford <aradford@xxxxxxxxx>

diff -Naur linux-2.6.38-rc5/drivers/scsi/megaraid/megaraid_sas_base.c
linux-2.6.38-rc5.new/drivers/scsi/megaraid/megaraid_sas_base.c
--- linux-2.6.38-rc5/drivers/scsi/megaraid/megaraid_sas_base.c	2011-02-15
19:23:45.000000000 -0800
+++ linux-2.6.38-rc5.new/drivers/scsi/megaraid/megaraid_sas_base.c	2011-02-19
13:31:40.505394814 -0800
@@ -3424,7 +3424,6 @@
 	megasas_free_cmds(instance);

 fail_alloc_cmds:
-	iounmap(instance->reg_set);
 	return 1;
 }

@@ -3494,7 +3493,7 @@

 	/* Get operational params, sge flags, send init cmd to controller */
 	if (instance->instancet->init_adapter(instance))
-		return -ENODEV;
+		goto fail_init_adapter;

 	printk(KERN_ERR "megasas: INIT adapter done\n");

@@ -3553,6 +3552,7 @@
 				MEGASAS_COMPLETION_TIMER_INTERVAL);
 	return 0;

+fail_init_adapter:
 fail_ready_state:
 	iounmap(instance->reg_set);

@@ -4107,7 +4107,10 @@
 		 instance->pdev->irq, instance);
 	if (instance->msi_flag)
 		pci_disable_msix(instance->pdev);
-
+	if (instance->pdev->device == PCI_DEVICE_ID_LSI_FUSION)
+		megasas_release_fusion(instance);
+	else
+		megasas_release_mfi(instance);
       fail_irq:
       fail_init_mfi:
       fail_alloc_dma_buf:
@@ -4116,13 +4119,9 @@
 				    instance->evt_detail,
 				    instance->evt_detail_h);

-	if (instance->producer) {
+	if (instance->producer)
 		pci_free_consistent(pdev, sizeof(u32), instance->producer,
 				    instance->producer_h);
-		megasas_release_mfi(instance);
-	} else {
-		megasas_release_fusion(instance);
-	}
 	if (instance->consumer)
 		pci_free_consistent(pdev, sizeof(u32), instance->consumer,
 				    instance->consumer_h);
diff -Naur linux-2.6.38-rc5/drivers/scsi/megaraid/megaraid_sas_fusion.c
linux-2.6.38-rc5.new/drivers/scsi/megaraid/megaraid_sas_fusion.c
--- linux-2.6.38-rc5/drivers/scsi/megaraid/megaraid_sas_fusion.c	2011-02-15
19:23:45.000000000 -0800
+++ linux-2.6.38-rc5.new/drivers/scsi/megaraid/megaraid_sas_fusion.c	2011-02-19
13:30:04.826364313 -0800
@@ -984,13 +984,15 @@

 	return 0;

-fail_alloc_cmds:
-fail_alloc_mfi_cmds:
 fail_map_info:
 	if (i == 1)
 		dma_free_coherent(&instance->pdev->dev, fusion->map_sz,
 				  fusion->ld_map[0], fusion->ld_map_phys[0]);
 fail_ioc_init:
+	megasas_free_cmds_fusion(instance);
+fail_alloc_cmds:
+	megasas_free_cmds(instance);
+fail_alloc_mfi_cmds:
 	return 1;
 }

Attachment: megaraid_sas.patch1
Description: Binary data


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux