Skip to contentSkip to conversation

release net when pneigh_lookup fails

PATCH In review Daniel Lezcano 2 participants 3 messages Oct 30, 2007 1 message not in the archive Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 release net when pneigh_lookup fails

When the neighbour table constructor fails, the network namespace is not released. This patch fix that.

---
 net/core/neighbour.c |    1 +
 1 file changed, 1 insertion(+)
net/core/neighbour.c +1 -0
Index: 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;

A message that is not in the archive (sent off-list or not yet received): 47272C3B.5080601-NmTC/[email protected]

#2 lore raw
Quoted 13 lines · Daniel Lezcano

Index: linux-2.6-netns/net/core/neighbour.c
===================================================================

net/core/neighbour.c +1 -0
@@ -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;
Quoted 1 line

_______________________________________________

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

-- Dave

#3 lore raw
Quoted 17 lines · Dave Hansen
Quoted 12 lines · Daniel Lezcano

Index: linux-2.6-netns/net/core/neighbour.c
===================================================================

net/core/neighbour.c +1 -0
@@ -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;
Quoted 1 line

_______________________________________________

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.