[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220308065527.90341-1-fufuyqqqqqq@gmail.com>
Date: Mon, 7 Mar 2022 22:55:26 -0800
From: Yeqi Fu <fufuyqqqqqq@...il.com>
To: Hannes Reinecke <hare@...e.de>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
lyz_cs@....edu.cn, Yeqi Fu <fuyq@....pku.edu.cn>
Subject: [PATCH 1/2] scsi: fcoe: fix memory leak
From: Yeqi Fu <fuyq@....pku.edu.cn>
Resource release is needed on the error handling branch
to prevent memory leak. Fix this by adding kfree to the
error handling branch.
Signed-off-by: Yeqi Fu <fuyq@....pku.edu.cn>
---
drivers/scsi/fcoe/fcoe.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 44ca6110213c..dbc202f2f05a 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -829,6 +829,7 @@ static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev)
if (rc) {
printk(KERN_INFO "fcoe: Failed to retrieve FDMI "
"information from netdev.\n");
+ kfree(fdmi);
return;
}
--
2.30.2
Powered by blists - more mailing lists