This is a note to let you know that I've just added the patch titled net: dsa: qca8k: put MDIO controller OF node if unavailable to the 6.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-dsa-qca8k-put-mdio-controller-of-node-if-unavail.patch and it can be found in the queue-6.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 430fce46ea5d4757a243456a6e2c34d17803089d Author: Vladimir Oltean <vladimir.oltean@xxxxxxx> Date: Fri Feb 2 18:36:25 2024 +0200 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@xxxxxxxxxxxxxx/ Suggested-by: Luiz Angelo Daros de Luca <luizluca@xxxxxxxxx> Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c index 7a864329cb726..95d78b3181d1c 100644 --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c @@ -954,7 +954,7 @@ qca8k_mdio_register(struct qca8k_priv *priv) mdio = of_get_child_by_name(dev->of_node, "mdio"); if (mdio && !of_device_is_available(mdio)) - goto out; + goto out_put_node; bus = devm_mdiobus_alloc(dev); if (!bus) { @@ -988,7 +988,6 @@ qca8k_mdio_register(struct qca8k_priv *priv) out_put_node: of_node_put(mdio); -out: return err; }