diff options
-rw-r--r-- | net/ipv6/route.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 6293cb91ed1..210a079cfc6 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2622,7 +2622,7 @@ static int ip6_route_net_init(struct net *net) | |||
2622 | GFP_KERNEL); | 2622 | GFP_KERNEL); |
2623 | if (!net->ipv6.ip6_dst_ops) | 2623 | if (!net->ipv6.ip6_dst_ops) |
2624 | goto out; | 2624 | goto out; |
2625 | net->ipv6.ip6_dst_ops->dst_net = net; | 2625 | net->ipv6.ip6_dst_ops->dst_net = hold_net(net); |
2626 | 2626 | ||
2627 | net->ipv6.ip6_null_entry = kmemdup(&ip6_null_entry_template, | 2627 | net->ipv6.ip6_null_entry = kmemdup(&ip6_null_entry_template, |
2628 | sizeof(*net->ipv6.ip6_null_entry), | 2628 | sizeof(*net->ipv6.ip6_null_entry), |
@@ -2669,6 +2669,7 @@ out: | |||
2669 | return ret; | 2669 | return ret; |
2670 | 2670 | ||
2671 | out_ip6_dst_ops: | 2671 | out_ip6_dst_ops: |
2672 | release_net(net->ipv6.ip6_dst_ops->dst_net); | ||
2672 | kfree(net->ipv6.ip6_dst_ops); | 2673 | kfree(net->ipv6.ip6_dst_ops); |
2673 | goto out; | 2674 | goto out; |
2674 | } | 2675 | } |
@@ -2684,6 +2685,7 @@ static void ip6_route_net_exit(struct net *net) | |||
2684 | kfree(net->ipv6.ip6_prohibit_entry); | 2685 | kfree(net->ipv6.ip6_prohibit_entry); |
2685 | kfree(net->ipv6.ip6_blk_hole_entry); | 2686 | kfree(net->ipv6.ip6_blk_hole_entry); |
2686 | #endif | 2687 | #endif |
2688 | release_net(net->ipv6.ip6_dst_ops->dst_net); | ||
2687 | kfree(net->ipv6.ip6_dst_ops); | 2689 | kfree(net->ipv6.ip6_dst_ops); |
2688 | } | 2690 | } |
2689 | 2691 | ||