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

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