Blame SOURCES/0174-libcxl-Fix-memory-leakage-in-cxl_port_init.patch

26ccd9
From 29a9e9daa67e2b68bb2433c31fdbc82e86b5f0fe Mon Sep 17 00:00:00 2001
26ccd9
From: Shivaprasad G Bhat <sbhat@linux.ibm.com>
26ccd9
Date: Mon, 18 Jul 2022 13:53:35 +0530
26ccd9
Subject: [PATCH 174/217] libcxl: Fix memory leakage in cxl_port_init()
26ccd9
26ccd9
The local variable 'path' is not freed in cxl_port_init() for success case.
26ccd9
The patch fixes that.
26ccd9
26ccd9
Link: https://lore.kernel.org/r/165813258358.95191.6678871197554236554.stgit@LAPTOP-TBQTPII8
26ccd9
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
26ccd9
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
26ccd9
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
26ccd9
---
26ccd9
 cxl/lib/libcxl.c | 1 +
26ccd9
 1 file changed, 1 insertion(+)
26ccd9
26ccd9
diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c
26ccd9
index c988ce2..bf3568d 100644
26ccd9
--- a/cxl/lib/libcxl.c
26ccd9
+++ b/cxl/lib/libcxl.c
26ccd9
@@ -769,6 +769,7 @@ static int cxl_port_init(struct cxl_port *port, struct cxl_port *parent_port,
26ccd9
 	if (sysfs_read_attr(ctx, path, buf) == 0)
26ccd9
 		port->module = util_modalias_to_module(ctx, buf);
26ccd9
 
26ccd9
+	free(path);
26ccd9
 	return 0;
26ccd9
 err:
26ccd9
 	free(port->dev_path);
26ccd9
-- 
26ccd9
2.27.0
26ccd9