[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <224d92ed-17cf-46d1-90f4-7b9dd0407cb1@roeck-us.net>
Date: Thu, 4 Dec 2025 20:07:37 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: xiaopeitux@...mail.com
Cc: linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
florin.leotescu@....com, Pei Xiao <xiaopei01@...inos.cn>
Subject: Re: [PATCH] hwmon: (emc2305): fix device node refcount leak in error
path
On Fri, Dec 05, 2025 at 11:15:13AM +0800, xiaopeitux@...mail.com wrote:
> From: Pei Xiao <xiaopei01@...inos.cn>
>
> The for_each_child_of_node() macro automatically manages device node
> reference counts during normal iteration. However, when breaking out
> of the loop early with return, the current iteration's node is not
> automatically released, leading to a reference count leak.
>
> Fix this by adding of_node_put(child) before returning from the loop
> when emc2305_set_single_tz() fails.
>
> This issue could lead to memory leaks over multiple probe cycles.
>
> Signed-off-by: Pei Xiao <xiaopei01@...inos.cn>
Applied.
Thanks,
Guenter
Powered by blists - more mailing lists