| From 04b945802db3b0ae0b3d81fef071be499a8fd6da Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Tue, 11 Nov 2025 15:50:00 +0800 |
| Subject: ACPI: property: Fix fwnode refcount leak in |
| acpi_fwnode_graph_parse_endpoint() |
| |
| From: Haotian Zhang <vulab@iscas.ac.cn> |
| |
| [ Upstream commit 593ee49222a0d751062fd9a5e4a963ade4ec028a ] |
| |
| acpi_fwnode_graph_parse_endpoint() calls fwnode_get_parent() to obtain the |
| parent fwnode but returns without calling fwnode_handle_put() on it. This |
| potentially leads to a fwnode refcount leak and prevents the parent node |
| from being released properly. |
| |
| Call fwnode_handle_put() on the parent fwnode before returning to prevent |
| the leak from occurring. |
| |
| Fixes: 3b27d00e7b6d ("device property: Move fwnode graph ops to firmware specific locations") |
| Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> |
| Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> |
| [ rjw: Changelog edits ] |
| Link: https://patch.msgid.link/20251111075000.1828-1-vulab@iscas.ac.cn |
| Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/acpi/property.c | 1 + |
| 1 file changed, 1 insertion(+) |
| |
| diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c |
| index 9f7880cc2bd8c..0ff1c3d2504d4 100644 |
| --- a/drivers/acpi/property.c |
| +++ b/drivers/acpi/property.c |
| @@ -1634,6 +1634,7 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode, |
| if (fwnode_property_read_u32(fwnode, "reg", &endpoint->id)) |
| fwnode_property_read_u32(fwnode, "endpoint", &endpoint->id); |
| |
| + fwnode_handle_put(port_fwnode); |
| return 0; |
| } |
| |
| -- |
| 2.51.0 |
| |