linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/9] staging: otus: use free_netdev(netdev) instead of kfree()
@ 2010-09-26  9:58 Vasiliy Kulikov
  0 siblings, 0 replies; 2+ messages in thread
From: Vasiliy Kulikov @ 2010-09-26  9:58 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Greg Kroah-Hartman, Tejun Heo, Jeff Mahoney, Mithlesh Thukral,
	Joe Perches, devel, 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)
---
 Compile tested.

 drivers/staging/otus/usbdrv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/otus/usbdrv.c b/drivers/staging/otus/usbdrv.c
index 165a82b..9a5c415 100644
--- a/drivers/staging/otus/usbdrv.c
+++ b/drivers/staging/otus/usbdrv.c
@@ -690,7 +690,7 @@ void usbdrv_clear_structs(struct net_device *dev)
 
     kfree(macp);
 
-    kfree(dev);
+    free_netdev(dev);
 
 }
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 7/9] staging: otus: use free_netdev(netdev) instead of kfree()
@ 2010-09-28 17:08 Vasiliy Kulikov
  0 siblings, 0 replies; 2+ messages in thread
From: Vasiliy Kulikov @ 2010-09-28 17:08 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Greg Kroah-Hartman, Tejun Heo, Jeff Mahoney, Mithlesh Thukral,
	Joe Perches, devel, 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)

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
 Compile tested.

 drivers/staging/otus/usbdrv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/otus/usbdrv.c b/drivers/staging/otus/usbdrv.c
index 165a82b..9a5c415 100644
--- a/drivers/staging/otus/usbdrv.c
+++ b/drivers/staging/otus/usbdrv.c
@@ -690,7 +690,7 @@ void usbdrv_clear_structs(struct net_device *dev)
 
     kfree(macp);
 
-    kfree(dev);
+    free_netdev(dev);
 
 }
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-28 17:08 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 7/9] staging: otus: use free_netdev(netdev) instead of kfree() Vasiliy Kulikov
2010-09-28 17:08 Vasiliy Kulikov

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).