[PATCH] scsi: lpfc: Remove redundant assignment to avoid memory leak

Jiasheng Jiang posted 1 patch 2 months ago
drivers/scsi/lpfc/lpfc_debugfs.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] scsi: lpfc: Remove redundant assignment to avoid memory leak
Posted by Jiasheng Jiang 2 months ago
Remove the redundant assignment if kzalloc() succeeds to avoid memory leak.

Fixes: bd2cdd5e400f ("scsi: lpfc: NVME Initiator: Add debugfs support")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
 drivers/scsi/lpfc/lpfc_debugfs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index 2db8d9529b8f..7c4d7bb3a56f 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -6280,7 +6280,6 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
 			}
 			phba->nvmeio_trc_on = 1;
 			phba->nvmeio_trc_output_idx = 0;
-			phba->nvmeio_trc = NULL;
 		} else {
 nvmeio_off:
 			phba->nvmeio_trc_size = 0;
-- 
2.25.1
Re: [PATCH] scsi: lpfc: Remove redundant assignment to avoid memory leak
Posted by Justin Tee 2 months ago
Reviewed-by: Justin Tee <justin.tee@broadcom.com>

Regards,
Justin
Re: [PATCH] scsi: lpfc: Remove redundant assignment to avoid memory leak
Posted by Martin K. Petersen 2 months ago
Jiasheng,

> Remove the redundant assignment if kzalloc() succeeds to avoid memory
> leak.

Applied to 6.17/scsi-staging, thanks!

-- 
Martin K. Petersen