[PATCH] coresight: Fix fwnode leak on failed connection add in ACPI path

Xiangwu Lai laixiangwu at cmss.chinamobile.com
Wed Nov 11 18:17:41 PST 2026


In acpi_coresight_parse_graph(), acpi_coresight_parse_link() takes a
reference on the remote device's fwnode and stores it in
conn->dest_fwnode.  If coresight_add_out_conn() then fails, the
ACPI graph parser jumps to the free label without dropping that
reference.  The failed connection never enters the platform data,
so nothing ever releases it and the reference is leaked for every
failed link.

The OF path in the same file already releases the reference on the
same error path, so add the missing fwnode_handle_put() to the ACPI
path as well.

Fixes: 3d4ff657e454 ("coresight: Dynamically add connections")
Signed-off-by: Xiangwu Lai <laixiangwu at cmss.chinamobile.com>
---
 drivers/hwtracing/coresight/coresight-platform.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
index 93c2d075c..6b7a87680 100644
--- a/drivers/hwtracing/coresight/coresight-platform.c
+++ b/drivers/hwtracing/coresight/coresight-platform.c
@@ -718,6 +718,7 @@ static int acpi_coresight_parse_graph(struct device *dev,
 		if (dir == ACPI_CORESIGHT_LINK_MASTER) {
 			new_conn = coresight_add_out_conn(dev, pdata, &conn);
 			if (IS_ERR(new_conn)) {
+				fwnode_handle_put(conn.dest_fwnode);
 				ret = PTR_ERR(new_conn);
 				goto free;
 			}
-- 
2.50.1.windows.1






More information about the linux-arm-kernel mailing list