OpenVZ Forum


Home » Mailing lists » Devel » [PATCH][NETNS] release net when pneigh_lookup fails
[PATCH][NETNS] release net when pneigh_lookup fails [message #22538] Tue, 30 October 2007 13:06 Go to next message
Daniel Lezcano is currently offline  Daniel Lezcano
Messages: 417
Registered: June 2006
Senior Member
When the neighbour table constructor fails, the network namespace is
not released. This patch fix that.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
---
  net/core/neighbour.c |    1 +
  1 file changed, 1 insertion(+)

Index: linux-2.6-netns/net/core/neighbour.c
===================================================================
--- linux-2.6-netns.orig/net/core/neighbour.c
+++ linux-2.6-netns/net/core/neighbour.c
@@ -497,6 +497,7 @@ struct pneigh_entry * pneigh_lookup(stru
         if (tbl->pconstructor && tbl->pconstructor(n)) {
                 if (dev)
                         dev_put(dev);
+               release_net(n->net);
                 kfree(n);
                 n = NULL;
                 goto out;
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH][NETNS] release net when pneigh_lookup fails [message #22544 is a reply to message #22538] Tue, 30 October 2007 16:35 Go to previous messageGo to next message
Dave Hansen is currently offline  Dave Hansen
Messages: 240
Registered: October 2005
Senior Member
On Tue, 2007-10-30 at 14:06 +0100, Daniel Lezcano wrote:
> 
> Index: linux-2.6-netns/net/core/neighbour.c
> ===================================================================
> --- linux-2.6-netns.orig/net/core/neighbour.c
> +++ linux-2.6-netns/net/core/neighbour.c
> @@ -497,6 +497,7 @@ struct pneigh_entry * pneigh_lookup(stru
>          if (tbl->pconstructor && tbl->pconstructor(n)) {
>                  if (dev)
>                          dev_put(dev);
> +               release_net(n->net);
>                  kfree(n);
>                  n = NULL;
>                  goto out;
> _______________________________________________ 

Looks like there are some tabs vs. spaces issues in there.  You should
probably just make your line match the ones around it.

-- Dave

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH][NETNS] release net when pneigh_lookup fails [message #22545 is a reply to message #22544] Tue, 30 October 2007 17:10 Go to previous message
Daniel Lezcano is currently offline  Daniel Lezcano
Messages: 417
Registered: June 2006
Senior Member
Dave Hansen wrote:
> On Tue, 2007-10-30 at 14:06 +0100, Daniel Lezcano wrote:
>> Index: linux-2.6-netns/net/core/neighbour.c
>> ===================================================================
>> --- linux-2.6-netns.orig/net/core/neighbour.c
>> +++ linux-2.6-netns/net/core/neighbour.c
>> @@ -497,6 +497,7 @@ struct pneigh_entry * pneigh_lookup(stru
>>          if (tbl->pconstructor && tbl->pconstructor(n)) {
>>                  if (dev)
>>                          dev_put(dev);
>> +               release_net(n->net);
>>                  kfree(n);
>>                  n = NULL;
>>                  goto out;
>> _______________________________________________ 
> 
> Looks like there are some tabs vs. spaces issues in there.  You should
> probably just make your line match the ones around it.

Thanks Dave for pointing that. I stupidly did a copy/paste from emacs to 
thunderbird. Grr ...
I will resend this patch with correct indentation. Benjamin spotted this 
problem with the patches I sent to netdev@ too, they are already fixed.

Thansk again.



_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: [IPV6] cleanup : remove proc_net_remove called twice
Next Topic: [RFC] [-mm PATCH] Memory controller fix swap charging context in unuse_pte()
Goto Forum:
  


Current Time: Fri Sep 27 08:13:13 GMT 2024

Total time taken to generate the page: 0.04323 seconds