sgiseeq: use free_netdev(netdev) instead of kfree()
authorKulikov Vasiliy <segooon@gmail.com>
Sat, 25 Sep 2010 23:58:06 +0000 (23:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Sep 2010 01:54:34 +0000 (18:54 -0700)
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>
drivers/net/sgiseeq.c

index cc4bd8c65f8b6a58846065430f8b89c1be6a4bc3..9265315baa0b29bdc2c7a9e20db20462dcf52ae5 100644 (file)
@@ -804,7 +804,7 @@ static int __devinit sgiseeq_probe(struct platform_device *pdev)
 err_out_free_page:
        free_page((unsigned long) sp->srings);
 err_out_free_dev:
-       kfree(dev);
+       free_netdev(dev);
 
 err_out:
        return err;