0077-net-next-mediatek-use-mdiobus_free-in-favour-of-kfre.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From b1c85818c3fb00022dc125bb62d657d3fd3cf49c Mon Sep 17 00:00:00 2001
  2. From: John Crispin <john@phrozen.org>
  3. Date: Sat, 7 May 2016 06:31:08 +0200
  4. Subject: [PATCH 077/102] net-next: mediatek: use mdiobus_free() in favour of
  5. kfree()
  6. The driver currently uses kfree() to clear the mii_bus. This is not the
  7. correct way to clear the memory and mdiobus_free() should be used instead.
  8. This patch fixes the two instances where this happens in the driver.
  9. Reviewed-by: Andrew Lunn <andrew@lunn.ch>
  10. Signed-off-by: John Crispin <john@phrozen.org>
  11. ---
  12. drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++--
  13. 1 file changed, 2 insertions(+), 2 deletions(-)
  14. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  15. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  16. @@ -280,7 +280,7 @@ static int mtk_mdio_init(struct mtk_eth
  17. return 0;
  18. err_free_bus:
  19. - kfree(eth->mii_bus);
  20. + mdiobus_free(eth->mii_bus);
  21. err_put_node:
  22. of_node_put(mii_np);
  23. @@ -295,7 +295,7 @@ static void mtk_mdio_cleanup(struct mtk_
  24. mdiobus_unregister(eth->mii_bus);
  25. of_node_put(eth->mii_bus->dev.of_node);
  26. - kfree(eth->mii_bus);
  27. + mdiobus_free(eth->mii_bus);
  28. }
  29. static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask)