Re: [PATCH] scsi: megaraid_sas: remove unnecessary kfree

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

 



Hi,

Gentle ping.

在 2022/8/2 15:19, Guixin Liu 写道:
When alloc ctrl mem fail, the reply_map will be free in
megasas_free_ctrl_mem(), no need to free in megasas_alloc_ctrl_mem().

Signed-off-by: Guixin Liu <kanie@xxxxxxxxxxxxxxxxx>
---
  drivers/scsi/megaraid/megaraid_sas_base.c | 8 ++------
  1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index a3e117a..f6c37a9 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -7153,22 +7153,18 @@ static int megasas_alloc_ctrl_mem(struct megasas_instance *instance)
  	switch (instance->adapter_type) {
  	case MFI_SERIES:
  		if (megasas_alloc_mfi_ctrl_mem(instance))
-			goto fail;
+			return -ENOMEM;
  		break;
  	case AERO_SERIES:
  	case VENTURA_SERIES:
  	case THUNDERBOLT_SERIES:
  	case INVADER_SERIES:
  		if (megasas_alloc_fusion_context(instance))
-			goto fail;
+			return -ENOMEM;
  		break;
  	}
return 0;
- fail:
-	kfree(instance->reply_map);
-	instance->reply_map = NULL;
-	return -ENOMEM;
  }
/*



[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