[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1280861625-4804-1-git-send-email-weil@mail.berlios.de>
Date: Tue, 3 Aug 2010 20:53:45 +0200
From: Stefan Weil <weil@...l.berlios.de>
To: netdev@...r.kernel.org
Cc: Stefan Weil <weil@...l.berlios.de>,
"David S. Miller" <davem@...emloft.net>,
Chaithrika U S <chaithrika@...com>,
Sriramakrishnan <srk@...com>,
Kevin Hilman <khilman@...prootsystems.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] 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@...emloft.net>
Cc: Chaithrika U S <chaithrika@...com>
Cc: Sriramakrishnan <srk@...com>
Cc: Kevin Hilman <khilman@...prootsystems.com>
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Signed-off-by: Stefan Weil <weil@...l.berlios.de>
---
drivers/net/davinci_emac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 8cc8a43..866e6b8 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -2818,8 +2818,8 @@ static int __devexit davinci_emac_remove(struct platform_device *pdev)
release_mem_region(res->start, res->end - res->start + 1);
unregister_netdev(ndev);
- free_netdev(ndev);
iounmap(priv->remap_addr);
+ free_netdev(ndev);
clk_disable(emac_clk);
clk_put(emac_clk);
--
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists