summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-16 11:01:34 +0200
committerDavid S. Miller <davem@davemloft.net>2008-04-16 11:01:34 +0200
commit48115becf6ad9c0e700ff7c1792b7f2a288ef8fb (patch)
treeb0ec6b3e4094e661dbea043d50acb6c5824e542a /net/ipv6
parent[NETNS]: Add netns refcnt debug for inet bind buckets. (diff)
downloadlinux-48115becf6ad9c0e700ff7c1792b7f2a288ef8fb.tar.xz
linux-48115becf6ad9c0e700ff7c1792b7f2a288ef8fb.zip
[NETNS]: Add netns refcnt debug for dst ops.
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/route.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6293cb91ed1d..210a079cfc6f 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2622,7 +2622,7 @@ static int ip6_route_net_init(struct net *net)
GFP_KERNEL);
if (!net->ipv6.ip6_dst_ops)
goto out;
- net->ipv6.ip6_dst_ops->dst_net = net;
+ net->ipv6.ip6_dst_ops->dst_net = hold_net(net);
net->ipv6.ip6_null_entry = kmemdup(&ip6_null_entry_template,
sizeof(*net->ipv6.ip6_null_entry),
@@ -2669,6 +2669,7 @@ out:
return ret;
out_ip6_dst_ops:
+ release_net(net->ipv6.ip6_dst_ops->dst_net);
kfree(net->ipv6.ip6_dst_ops);
goto out;
}
@@ -2684,6 +2685,7 @@ static void ip6_route_net_exit(struct net *net)
kfree(net->ipv6.ip6_prohibit_entry);
kfree(net->ipv6.ip6_blk_hole_entry);
#endif
+ release_net(net->ipv6.ip6_dst_ops->dst_net);
kfree(net->ipv6.ip6_dst_ops);
}