aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f4385a6569c2..635d97d54b0a 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2631,10 +2631,8 @@ static int ip6_route_net_init(struct net *net)
2631 net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, 2631 net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
2632 sizeof(*net->ipv6.ip6_prohibit_entry), 2632 sizeof(*net->ipv6.ip6_prohibit_entry),
2633 GFP_KERNEL); 2633 GFP_KERNEL);
2634 if (!net->ipv6.ip6_prohibit_entry) { 2634 if (!net->ipv6.ip6_prohibit_entry)
2635 kfree(net->ipv6.ip6_null_entry); 2635 goto out_ip6_null_entry;
2636 goto out;
2637 }
2638 net->ipv6.ip6_prohibit_entry->u.dst.path = 2636 net->ipv6.ip6_prohibit_entry->u.dst.path =
2639 (struct dst_entry *)net->ipv6.ip6_prohibit_entry; 2637 (struct dst_entry *)net->ipv6.ip6_prohibit_entry;
2640 net->ipv6.ip6_prohibit_entry->u.dst.ops = net->ipv6.ip6_dst_ops; 2638 net->ipv6.ip6_prohibit_entry->u.dst.ops = net->ipv6.ip6_dst_ops;
@@ -2642,11 +2640,8 @@ static int ip6_route_net_init(struct net *net)
2642 net->ipv6.ip6_blk_hole_entry = kmemdup(&ip6_blk_hole_entry_template, 2640 net->ipv6.ip6_blk_hole_entry = kmemdup(&ip6_blk_hole_entry_template,
2643 sizeof(*net->ipv6.ip6_blk_hole_entry), 2641 sizeof(*net->ipv6.ip6_blk_hole_entry),
2644 GFP_KERNEL); 2642 GFP_KERNEL);
2645 if (!net->ipv6.ip6_blk_hole_entry) { 2643 if (!net->ipv6.ip6_blk_hole_entry)
2646 kfree(net->ipv6.ip6_null_entry); 2644 goto out_ip6_prohibit_entry;
2647 kfree(net->ipv6.ip6_prohibit_entry);
2648 goto out;
2649 }
2650 net->ipv6.ip6_blk_hole_entry->u.dst.path = 2645 net->ipv6.ip6_blk_hole_entry->u.dst.path =
2651 (struct dst_entry *)net->ipv6.ip6_blk_hole_entry; 2646 (struct dst_entry *)net->ipv6.ip6_blk_hole_entry;
2652 net->ipv6.ip6_blk_hole_entry->u.dst.ops = net->ipv6.ip6_dst_ops; 2647 net->ipv6.ip6_blk_hole_entry->u.dst.ops = net->ipv6.ip6_dst_ops;
@@ -2662,6 +2657,12 @@ static int ip6_route_net_init(struct net *net)
2662out: 2657out:
2663 return ret; 2658 return ret;
2664 2659
2660#ifdef CONFIG_IPV6_MULTIPLE_TABLES
2661out_ip6_prohibit_entry:
2662 kfree(net->ipv6.ip6_prohibit_entry);
2663out_ip6_null_entry:
2664 kfree(net->ipv6.ip6_null_entry);
2665#endif
2665out_ip6_dst_ops: 2666out_ip6_dst_ops:
2666 release_net(net->ipv6.ip6_dst_ops->dst_net); 2667 release_net(net->ipv6.ip6_dst_ops->dst_net);
2667 kfree(net->ipv6.ip6_dst_ops); 2668 kfree(net->ipv6.ip6_dst_ops);