net: dsa: lantiq_gswip: fix use after free in gswip_remove()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Tue, 15 Feb 2022 10:42:48 +0000 (13:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Feb 2022 11:03:11 +0000 (12:03 +0100)
commitdf2495f329b08ac0d0d3e6334a01955ae839005e
tree659752804bdd53b19a378d6b36715dafb3c0211c
parent2566a89b9e163b2fcd104d6005e0149f197b8a48
net: dsa: lantiq_gswip: fix use after free in gswip_remove()

commit 8c6ae46150a453f8ae9a6cd49b45f354f478587d upstream.

of_node_put(priv->ds->slave_mii_bus->dev.of_node) should be
done before mdiobus_free(priv->ds->slave_mii_bus).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 0d120dfb5d67 ("net: dsa: lantiq_gswip: don't use devres for mdiobus")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/1644921768-26477-1-git-send-email-khoroshilov@ispras.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/lantiq_gswip.c