[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20231227054255.28583-1-dinghao.liu@zju.edu.cn>
Date: Wed, 27 Dec 2023 13:42:55 +0800
From: Dinghao Liu <dinghao.liu@....edu.cn>
To: dinghao.liu@....edu.cn
Cc: Saurav Kashyap <skashyap@...vell.com>,
Javed Hasan <jhasan@...vell.com>,
GR-QLogic-Storage-Upstream@...vell.com,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"Dupuis, Chad" <chad.dupuis@...ium.com>,
Manish Rangankar <manish.rangankar@...ium.com>,
Nilesh Javali <nilesh.javali@...ium.com>,
linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] scsi: qedf: fix a memleak in qedf_alloc_global_queues
When qedf_alloc_bdq() fails, qedf->global_queues should
be freed to prevent potential memleak. It's the same for
the following error handling paths.
Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.")
Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
---
drivers/scsi/qedf/qedf_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index a58353b7b4e8..2261efcf2dbb 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -3155,6 +3155,7 @@ static int qedf_alloc_global_queues(struct qedf_ctx *qedf)
mem_alloc_failure:
qedf_free_global_queues(qedf);
+ kfree(qedf->global_queues);
return status;
}
--
2.17.1
Powered by blists - more mailing lists