]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: lpfc: Fix memory leak when nvmeio_trc debugfs entry is used
authorJustin Tee <justin.tee@broadcom.com>
Mon, 15 Sep 2025 18:08:06 +0000 (11:08 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 17 Sep 2025 02:20:00 +0000 (22:20 -0400)
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: Justin Tee <justin.tee@broadcom.com>
Message-ID: <20250915180811.137530-10-justintee8345@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_debugfs.c

index 2db8d9529b8fd4816b3938a1b0e63816b38537d8..7c4d7bb3a56f570fd96a2958daed9085abb2c357 100644 (file)
@@ -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;