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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index d1ddbc6ddac5..7c7e963260e1 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1593,17 +1593,18 @@ static int __ip6_del_rt(struct rt6_info *rt, struct nl_info *info)
1593 struct fib6_table *table; 1593 struct fib6_table *table;
1594 struct net *net = dev_net(rt->dst.dev); 1594 struct net *net = dev_net(rt->dst.dev);
1595 1595
1596 if (rt == net->ipv6.ip6_null_entry) 1596 if (rt == net->ipv6.ip6_null_entry) {
1597 return -ENOENT; 1597 err = -ENOENT;
1598 goto out;
1599 }
1598 1600
1599 table = rt->rt6i_table; 1601 table = rt->rt6i_table;
1600 write_lock_bh(&table->tb6_lock); 1602 write_lock_bh(&table->tb6_lock);
1601
1602 err = fib6_del(rt, info); 1603 err = fib6_del(rt, info);
1603 dst_release(&rt->dst);
1604
1605 write_unlock_bh(&table->tb6_lock); 1604 write_unlock_bh(&table->tb6_lock);
1606 1605
1606out:
1607 dst_release(&rt->dst);
1607 return err; 1608 return err;
1608} 1609}
1609 1610