Re: [PATCH net v2 4/6] net: bcmasp: fix OF node reference leak for phy_dn
From: Justin Chen
Date: Fri Oct 09 2026 - 15:14:00 EST
On 10/8/26 2:06 PM, Florian Fainelli wrote:
In bcmasp_interface_create(), intf->phy_dn is obtained viaReviewed-by: Justin Chen <justin.chen@xxxxxxxxxxxx>
of_parse_phandle() or assigned ndev_dn. of_parse_phandle() returns a
node reference with its refcount incremented, but of_node_put() was
never called on intf->phy_dn in bcmasp_interface_destroy() or the
error unwind path in bcmasp_interface_create().
Acquire a reference on ndev_dn for the fixed-link case as well so that
intf->phy_dn consistently holds a reference, and release it with
of_node_put() on teardown and error.
Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
Assisted-by: LLM
Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
Signed-off-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>