Skip to contentSkip to conversation

scsi: fcoe: add missed kfree() in an error path

PATCH Superseded Jing Xiangfeng 1 participant 1 message Jul 7, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: fcoe: add missed kfree() in an error path

fcoe_fdmi_info() misses to call kfree() in an error path. Add the missed function call to fix it.

Fixes f07d46bbc9ba ("fcoe: Fix smatch warning in fcoe_fdmi_info function")
---
 drivers/scsi/fcoe/fcoe.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/fcoe/fcoe.c +1 -0
index 25dae9f0b205..976f70cbe043 100644
@@ -830,6 +830,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;
 		}
 
Signature · 1 line
2.17.1