diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-09-26 01:58:00 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-27 03:54:32 +0200 |
commit | 52933f052186877afd218aef7a1b2dbdb010939f (patch) | |
tree | f2411bac21bebb47f105bb5237baba1ac16b7b16 | |
parent | smsc911x: Add MODULE_ALIAS() (diff) | |
download | linux-52933f052186877afd218aef7a1b2dbdb010939f.tar.xz linux-52933f052186877afd218aef7a1b2dbdb010939f.zip |
ibm_newemac: use free_netdev(netdev) instead of kfree()
Freeing netdev without free_netdev() leads to net, tx leaks.
I might lead to dereferencing freed pointer.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
@@
struct net_device* dev;
@@
-kfree(dev)
+free_netdev(dev)
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ibm_newemac/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 3506fd6ad726..519e19e23955 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c @@ -2928,7 +2928,7 @@ static int __devinit emac_probe(struct platform_device *ofdev, if (dev->emac_irq != NO_IRQ) irq_dispose_mapping(dev->emac_irq); err_free: - kfree(ndev); + free_netdev(ndev); err_gone: /* if we were on the bootlist, remove us as we won't show up and * wake up all waiters to notify them in case they were waiting @@ -2971,7 +2971,7 @@ static int __devexit emac_remove(struct platform_device *ofdev) if (dev->emac_irq != NO_IRQ) irq_dispose_mapping(dev->emac_irq); - kfree(dev->ndev); + free_netdev(dev->ndev); return 0; } |