aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/davinci_emac.c
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2010-08-03 04:53:45 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-04 19:18:03 -0400
commit2a1bc0d56b446104a3a728925b3a7afbef64afa7 (patch)
tree2c484fa53420a3c673142551daccc45b0f803d10 /drivers/net/davinci_emac.c
parent889635fd6b269963f7e68b53c9f0f60c8008a77f (diff)
davinci_emac: Fix use after free in davinci_emac_remove
free_netdev finally calls kfree which makes the contents of ndev and priv (private data contained in ndev) invalid. So iounmap should be called before free_netdev. Cc: David S. Miller <davem@davemloft.net> Cc: Chaithrika U S <chaithrika@ti.com> Cc: Sriramakrishnan <srk@ti.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/davinci_emac.c')
-rw-r--r--drivers/net/davinci_emac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index d0824e322068..7fbd052ddb0a 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -2944,8 +2944,8 @@ static int __devexit davinci_emac_remove(struct platform_device *pdev)
2944 release_mem_region(res->start, res->end - res->start + 1); 2944 release_mem_region(res->start, res->end - res->start + 1);
2945 2945
2946 unregister_netdev(ndev); 2946 unregister_netdev(ndev);
2947 free_netdev(ndev);
2948 iounmap(priv->remap_addr); 2947 iounmap(priv->remap_addr);
2948 free_netdev(ndev);
2949 2949
2950 clk_disable(emac_clk); 2950 clk_disable(emac_clk);
2951 clk_put(emac_clk); 2951 clk_put(emac_clk);