]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: lpfc: Remove redundant assignment to avoid memory leak
authorJiasheng Jiang <jiashengjiangcool@gmail.com>
Fri, 1 Aug 2025 18:52:02 +0000 (18:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:33 +0000 (18:41 +0200)
[ Upstream commit eea6cafb5890db488fce1c69d05464214616d800 ]

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>
Link: https://lore.kernel.org/r/20250801185202.42631-1-jiashengjiangcool@gmail.com
Reviewed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_debugfs.c

index 3fd1aa5cc78cc8e252ced71f362890d983e4785d..1b601e45bc45c10c3ae96a4af17fa0e4c38fe167 100644 (file)
@@ -6289,7 +6289,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;