[PATCH] coresight: Fix fwnode leak on failed connection add in ACPI path
From: Xiangwu Lai
Date: Wed Nov 11 2026 - 21:21:00 EST
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@xxxxxxxxxxxxxxxxxxxx>
---
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