Skip to content

Commit

Permalink
[NETNS]: Add netns refcnt debug for dst ops.
Browse files Browse the repository at this point in the history
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Apr 16, 2008
1 parent 8c5da49 commit 48115be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}

Expand Down

0 comments on commit 48115be

Please sign in to comment.