]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: ti: icssm-prueth: fix eth_ports_node leak in probe
authorShitalkumar Gandhi <shital.gandhi45@gmail.com>
Wed, 6 May 2026 19:58:13 +0000 (01:28 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 May 2026 01:10:30 +0000 (18:10 -0700)
The error path on of_property_read_u32() failure inside
icssm_prueth_probe() returns without putting eth_ports_node,
which was acquired before the for_each_child_of_node() loop.

Drop it before returning.

Fixes: 511f6c1ae093 ("net: ti: icssm-prueth: Adds ICSSM Ethernet driver")
Signed-off-by: Shitalkumar Gandhi <shitalkumar.gandhi@cambiumnetworks.com>
Link: https://patch.msgid.link/20260506195813.641610-1-shitalkumar.gandhi@cambiumnetworks.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ti/icssm/icssm_prueth.c

index 53bbd929090423d70f1f35c6b2c686bfb68ae046..b7e94244355a3be28b9bea3cf9884718cfb4fdb9 100644 (file)
@@ -1825,6 +1825,7 @@ static int icssm_prueth_probe(struct platform_device *pdev)
                        dev_err(dev, "%pOF error reading port_id %d\n",
                                eth_node, ret);
                        of_node_put(eth_node);
+                       of_node_put(eth_ports_node);
                        return ret;
                }