From: Kulikov Vasiliy Date: Sat, 25 Sep 2010 23:58:06 +0000 (+0000) Subject: sgiseeq: use free_netdev(netdev) instead of kfree() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8d879de89807d82bc4cc3e9d73609b874fa9458c;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git sgiseeq: 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 --- diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index cc4bd8c65f8b..9265315baa0b 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c @@ -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;