[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <176866684353.2536773.12026289389990774200.robh@kernel.org>
Date: Sat, 17 Jan 2026 10:20:50 -0600
From: "Rob Herring (Arm)" <robh@...nel.org>
To: Weigang He <geoffreyhe2@...il.com>
Cc: stable@...r.kernel.org, shawn.guo@...aro.org, grant.likely@...retlab.ca,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
saravanak@...gle.com
Subject: Re: [PATCH] of: fix reference count leak in of_alias_scan()
On Sat, 17 Jan 2026 09:12:38 +0000, Weigang He wrote:
> of_find_node_by_path() returns a device_node with its refcount
> incremented. When kstrtoint() fails or dt_alloc() fails, the function
> continues to the next iteration without calling of_node_put(), causing
> a reference count leak.
>
> Add of_node_put(np) before continue on both error paths to properly
> release the device_node reference.
>
> Fixes: 611cad720148 ("dt: add of_alias_scan and of_alias_get_id")
> Cc: stable@...r.kernel.org
> Signed-off-by: Weigang He <geoffreyhe2@...il.com>
> ---
> drivers/of/base.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
Applied, thanks!
Powered by blists - more mailing lists