aboutsummaryrefslogtreecommitdiff
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDavid S. Miller2019-03-27 17:37:58 -0700
committerDavid S. Miller2019-03-27 17:37:58 -0700
commit356d71e00d278d865f8c7f68adebd6ce4698a7e2 (patch)
tree8cb2dabf7440b56c6dee76b4253210c6b603b98e /net/ipv6/route.c
parentdf453700e8d81b1bdafdf684365ee2b9431fb702 (diff)
parent1a9df9e29c2afecf6e3089442d429b377279ca3c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b804be3cbf05..61f231f58da5 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1039,14 +1039,20 @@ static struct rt6_info *ip6_create_rt_rcu(struct fib6_info *rt)
struct rt6_info *nrt;
if (!fib6_info_hold_safe(rt))
- return NULL;
+ goto fallback;
nrt = ip6_dst_alloc(dev_net(dev), dev, flags);
- if (nrt)
- ip6_rt_copy_init(nrt, rt);
- else
+ if (!nrt) {
fib6_info_release(rt);
+ goto fallback;
+ }
+ ip6_rt_copy_init(nrt, rt);
+ return nrt;
+
+fallback:
+ nrt = dev_net(dev)->ipv6.ip6_null_entry;
+ dst_hold(&nrt->dst);
return nrt;
}
@@ -1095,10 +1101,6 @@ restart:
dst_hold(&rt->dst);
} else {
rt = ip6_create_rt_rcu(f6i);
- if (!rt) {
- rt = net->ipv6.ip6_null_entry;
- dst_hold(&rt->dst);
- }
}
rcu_read_unlock();