linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead of kfree()
@ 2010-09-26  9:58 Vasiliy Kulikov
  2010-09-26 14:35 ` Denis Kirjanov
  0 siblings, 1 reply; 4+ 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] 4+ messages in thread

* Re: [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead of kfree()
  2010-09-26  9:58 [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead of kfree() Vasiliy Kulikov
@ 2010-09-26 14:35 ` Denis Kirjanov
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kirjanov @ 2010-09-26 14:35 UTC (permalink / raw)
  To: Vasiliy Kulikov
  Cc: kernel-janitors, Greg Kroah-Hartman, David S. Miller, Jiri Pirko,
	devel, linux-kernel

On 09/26/2010 01:58 PM, Vasiliy Kulikov wrote:
> 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);
>  }
>  
Acked-by: Denis Kirjanov <dkirjanov@kernel.org>

Good catch, thanks!

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

* Re: [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead of kfree()
  2010-09-28 17:08 Vasiliy Kulikov
@ 2010-09-28 19:23 ` Denis Kirjanov
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kirjanov @ 2010-09-28 19:23 UTC (permalink / raw)
  To: Vasiliy Kulikov
  Cc: kernel-janitors, Greg Kroah-Hartman, David S. Miller, Jiri Pirko,
	devel, linux-kernel

On 09/28/2010 09:08 PM, Vasiliy Kulikov wrote:
> 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/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);
>  }
>  
Acked-by: Denis Kirjanov <dkirjanov@kernel.org>

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

* [PATCH 8/9] staging: slicoss: use free_netdev(netdev) instead of kfree()
@ 2010-09-28 17:08 Vasiliy Kulikov
  2010-09-28 19:23 ` Denis Kirjanov
  0 siblings, 1 reply; 4+ messages in thread
From: Vasiliy Kulikov @ 2010-09-28 17:08 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)

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
 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] 4+ messages in thread

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

Thread overview: 4+ 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 14:35 ` Denis Kirjanov
2010-09-28 17:08 Vasiliy Kulikov
2010-09-28 19:23 ` Denis Kirjanov

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