net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
Subsystems (2)
PATCH 1/1 net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
Add missing of_node_put call to release device node tbi obtained via for_each_child_of_node.
--- drivers/net/ethernet/freescale/fsl_pq_mdio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/freescale/fsl_pq_mdio.c +2 -0
@@ -479,10 +479,12 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)"missing 'reg' property in node %pOF\n" , tbi); err = -EBUSY ; +of_node_put (tbi); goto error; }set_tbipa (*prop, pdev, data->get_tbipa, priv->map, &res); +of_node_put (tbi); } }
Signature · 1 line
2.43.0
Quoted 4 lines · Erick Karanja
Add missing
of_node_putcall to release device node tbi obtained viafor_each_child_of_node.Fixes afae5ad78b342 ("net/fsl_pq_mdio: streamline probing of MDIO nodes")
nit: no blank line here
Slightly more importantly, although the code you are changing was added by the cited commit, I think that the bug existed before then. I wonder if the fixes tag should be.
Quoted 2 lines
Signed-off-by Erick Karanja <[email protected]>
One minor comment on process: as a fix for networking code, most likely this should be targeted at the net tree. And that should be denoted in the subject like this:
Subject: [PATCH net] ...
And if you do post an updated version, which is probably not strictly necessary, please be sure to observe the 24h rule.
See: https://docs.kernel.org/process/maintainer-netdev.html
The code changes themselves look good to me. Thanks.
...
Simon Horman
reviewerQuoted 6 lines · Simon Horman
Quoted 4 lines · Erick Karanja
Add missing
of_node_putcall to release device node tbi obtained viafor_each_child_of_node.Fixes afae5ad78b342 ("net/fsl_pq_mdio: streamline probing of MDIO nodes")
Quoted 7 lines
nit: no blank line here
Slightly more importantly, although the code you are changing was added by the cited commit, I think that the bug existed before then. I wonder if the fixes tag should be.
Fixes daa26ea63c6f ("Merge branch 'octeontx2-fix-bitmap-leaks-in-pf-and-vf'")
Sorry the above is obviously bogus.
I should have said:
Quoted 21 lines
Quoted 3 lines
Signed-off-by Erick Karanja <[email protected]>One minor comment on process: as a fix for networking code, most likely this should be targeted at the net tree. And that should be denoted in the subject like this:
Subject: [PATCH net] ...
And if you do post an updated version, which is probably not strictly necessary, please be sure to observe the 24h rule.
See: https://docs.kernel.org/process/maintainer-netdev.html
The code changes themselves look good to me. Thanks.
Reviewed-by Simon Horman <[email protected]>...
Quoted 2 lines
Add missing
of_node_putcall to release device node tbi obtained viafor_each_child_of_node.
Will it become helpful to append parentheses to function names?
Regards,
Markus
Quoted 4 lines · Markus Elfring
Quoted 2 lines
Add missing
of_node_putcall to release device node tbi obtained viafor_each_child_of_node.Will it become helpful to append parentheses to function names?
Yes, it is necessary.
Quoted 3 lines
Regards,
Markus
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 2 Oct 2025 20:46:17 +0300 you wrote:
Add missing
of_node_putcall to release device node tbi obtained viafor_each_child_of_node.Fixes afae5ad78b342 ("net/fsl_pq_mdio: streamline probing of MDIO nodes")Signed-off-by Erick Karanja <[email protected]>[...]
Here is the summary with links:
- net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
https://git.kernel.org/netdev/net/c/521405cb54cd
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html