Commit 06d3c77c authored by Justin Tee's avatar Justin Tee Committed by Martin K. Petersen
Browse files

scsi: lpfc: Fix memory leak when nvmeio_trc debugfs entry is used



Right after phba->nvmeio_trc is kzalloc'ed, phba->nvmeio_trc is set to
NULL and the memory reference to free the kzalloc'ed memory is lost.
Remove the phba->nvmeio_trc NULL ptr assignment after kzalloc.
phba->nvmeio_trc is freed in lpfc_debugfs_terminate.

Signed-off-by: default avatarJustin Tee <justin.tee@broadcom.com>
Message-ID: <20250915180811.137530-10-justintee8345@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 5de09770
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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;