bcm53xx: build Tenda AC9 image
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.4 / 0077-net-next-mediatek-use-mdiobus_free-in-favour-of-kfre.patch
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
7 The driver currently uses kfree() to clear the mii_bus. This is not the
8 correct way to clear the memory and mdiobus_free() should be used instead.
9 This patch fixes the two instances where this happens in the driver.
10
11 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
12 Signed-off-by: John Crispin <john@phrozen.org>
13 ---
14 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
18 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
19 @@ -280,7 +280,7 @@ static int mtk_mdio_init(struct mtk_eth
20 return 0;
21
22 err_free_bus:
23 - kfree(eth->mii_bus);
24 + mdiobus_free(eth->mii_bus);
25
26 err_put_node:
27 of_node_put(mii_np);
28 @@ -295,7 +295,7 @@ static void mtk_mdio_cleanup(struct mtk_
29
30 mdiobus_unregister(eth->mii_bus);
31 of_node_put(eth->mii_bus->dev.of_node);
32 - kfree(eth->mii_bus);
33 + mdiobus_free(eth->mii_bus);
34 }
35
36 static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask)