All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead of kfree()
@ 2010-09-26  9:58 ` Vasiliy Kulikov
  0 siblings, 0 replies; 8+ messages in thread
From: Vasiliy Kulikov @ 2010-09-26  9:58 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Greg Kroah-Hartman, Denis Kirjanov, Kulikov Vasiliy,
	David S. Miller, Jiri Pirko, 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/slicoss/slicoss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 58ff123..18f1103 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -3233,7 +3233,7 @@ static void __devexit slic_entry_remove(struct pci_dev *pcidev)
 		slic_global.num_slic_cards--;
 		slic_card_cleanup(card);
 	}
-	kfree(dev);
+	free_netdev(dev);
 	pci_release_regions(pcidev);
 }
 
-- 
1.7.0.4


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

end of thread, other threads:[~2010-09-28 19:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-26  9:58 [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead of kfree() Vasiliy Kulikov
2010-09-26  9:58 ` Vasiliy Kulikov
2010-09-26 14:35 ` [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead Denis Kirjanov
2010-09-26 14:35   ` [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead of kfree() Denis Kirjanov
2010-09-28 17:08 ` Vasiliy Kulikov
2010-09-28 17:08   ` Vasiliy Kulikov
2010-09-28 19:23   ` [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead Denis Kirjanov
2010-09-28 19:23     ` [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead of kfree() Denis Kirjanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.