* [PATCH 3/9] sgiseeq: use free_netdev(netdev) instead of kfree()
@ 2010-09-26 9:58 Vasiliy Kulikov
2010-09-27 1:55 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Vasiliy Kulikov @ 2010-09-26 9:58 UTC (permalink / raw)
To: kernel-janitors
Cc: David S. Miller, Eric Dumazet, Uwe Kleine-König,
Julia Lawall, Tejun Heo, netdev, linux-kernel
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)
---
drivers/net/sgiseeq.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index cc4bd8c..9265315 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;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/9] sgiseeq: use free_netdev(netdev) instead of kfree()
2010-09-26 9:58 [PATCH 3/9] sgiseeq: use free_netdev(netdev) instead of kfree() Vasiliy Kulikov
@ 2010-09-27 1:55 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-09-27 1:55 UTC (permalink / raw)
To: segooon
Cc: kernel-janitors, eric.dumazet, u.kleine-koenig, julia, tj,
netdev, linux-kernel
From: Vasiliy Kulikov <segooon@gmail.com>
Date: Sun, 26 Sep 2010 13:58:06 +0400
> 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)
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-27 1:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-26 9:58 [PATCH 3/9] sgiseeq: use free_netdev(netdev) instead of kfree() Vasiliy Kulikov
2010-09-27 1:55 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).