mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
[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>
This commit is contained in:
parent
8c5da49a63
commit
48115becf6
1 changed files with 3 additions and 1 deletions
|
@ -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 @@ static int ip6_route_net_init(struct net *net)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue