[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0gs8nor-fgwcY8x4bkd9Swiu8yJn9296U7RHRnQUYDpdA@mail.gmail.com>
Date: Wed, 12 Nov 2025 14:48:30 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Haotian Zhang <vulab@...as.ac.cn>, Sakari Ailus <sakari.ailus@...ux.intel.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ACPI: property: Fix fwnode refcount leak in acpi_fwnode_graph_parse_endpoint()
On Tue, Nov 11, 2025 at 8:50 AM Haotian Zhang <vulab@...as.ac.cn> wrote:
>
> acpi_fwnode_graph_parse_endpoint() calls fwnode_get_parent() to obtain the
> parent fwnode but returns without calling fwnode_handle_put() on it. This
> 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
> fix the leak.
>
> Fixes: 3b27d00e7b6d ("device property: Move fwnode graph ops to firmware specific locations")
> Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
> ---
> drivers/acpi/property.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 1b997a5497e7..7f8790e8dc4e 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1714,6 +1714,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;
> }
>
> --
Andy, Sakari, this looks like a genuine fix to me, any comments?
Powered by blists - more mailing lists