Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f84d82f7a623f8641af2574425c329431ff158f
Commit:     4f84d82f7a623f8641af2574425c329431ff158f
Parent:     869e58f87094b1e8a0df49232e4a5172678d46c9
Author:     Denis V. Lunev <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 18 23:54:15 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:08:06 2008 -0800

    [NETNS]: Memory leak on network namespace stop.
    
    Network namespace allocates 2 kernel netlink sockets, fibnl &
    rtnl. These sockets should be disposed properly, i.e. by
    sock_release. Plain sock_put is not enough.
    
    Signed-off-by: Denis V. Lunev <[EMAIL PROTECTED]>
    Tested-by: Alexey Dobriyan <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/rtnetlink.c    |    2 +-
 net/ipv4/fib_frontend.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 8c45d7e..a5f4f66 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1384,7 +1384,7 @@ static void rtnetlink_net_exit(struct net *net)
                 * free.
                 */
                sk->sk_net = get_net(&init_net);
-               sock_put(sk);
+               sock_release(net->rtnl->sk_socket);
                net->rtnl = NULL;
        }
 }
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 8ddcd3f..4e5216e 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -881,7 +881,7 @@ static void nl_fib_lookup_exit(struct net *net)
         * initial network namespace. So the socket will  be safe to free.
         */
        net->ipv4.fibnl->sk_net = get_net(&init_net);
-       sock_put(net->ipv4.fibnl);
+       sock_release(net->ipv4.fibnl->sk_socket);
 }
 
 static void fib_disable_ip(struct net_device *dev, int force)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to