Commit 207bdf18 authored by John Crispin's avatar John Crispin Committed by David S. Miller

net-next: mediatek: use mdiobus_free() in favour of kfree()

The driver currently uses kfree() to clear the mii_bus. This is not the
correct way to clear the memory and mdiobus_free() should be used instead.
This patch fixes the two instances where this happens in the driver.
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJohn Crispin <john@phrozen.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8478b6cd
...@@ -280,7 +280,7 @@ static int mtk_mdio_init(struct mtk_eth *eth) ...@@ -280,7 +280,7 @@ static int mtk_mdio_init(struct mtk_eth *eth)
return 0; return 0;
err_free_bus: err_free_bus:
kfree(eth->mii_bus); mdiobus_free(eth->mii_bus);
err_put_node: err_put_node:
of_node_put(mii_np); of_node_put(mii_np);
...@@ -295,7 +295,7 @@ static void mtk_mdio_cleanup(struct mtk_eth *eth) ...@@ -295,7 +295,7 @@ static void mtk_mdio_cleanup(struct mtk_eth *eth)
mdiobus_unregister(eth->mii_bus); mdiobus_unregister(eth->mii_bus);
of_node_put(eth->mii_bus->dev.of_node); of_node_put(eth->mii_bus->dev.of_node);
kfree(eth->mii_bus); mdiobus_free(eth->mii_bus);
} }
static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask) static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment