]> git.itanic.dy.fi Git - linux-stable/commit
net: dsa: qca8k: put MDIO controller OF node if unavailable
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 2 Feb 2024 16:36:25 +0000 (18:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 11:09:57 +0000 (13:09 +0200)
commit8d390b8384aea399c86f96fca49e6231ee2b2958
treea9a704600aa5353e26721efa2b7775c7d6a5f2e8
parent649e24fc5cf7ae53143440448579d7c34ea252f2
net: dsa: qca8k: put MDIO controller OF node if unavailable

[ Upstream commit 08932323ccf7f8c4c85db9cb12a791ed81264f66 ]

It was pointed out during the review [1] of commit e66bf63a7f67 ("net:
dsa: qca8k: skip MDIO bus creation if its OF node has status =
"disabled"") that we now leak a reference to the "mdio" OF node if it is
disabled.

This is only a concern when using dynamic OF as far as I can tell (like
probing on an overlay), since OF nodes are never freed in the regular
case. Additionally, I'm unaware of any actual device trees (in
production or elsewhere) which have status = "disabled" for the MDIO OF
node. So handling this as a simple enhancement.

[1] https://lore.kernel.org/netdev/CAJq09z4--Ug+3FAmp=EimQ8HTQYOWOuVon-PUMGB5a1N=RPv4g@mail.gmail.com/

Suggested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/qca/qca8k-8xxx.c