aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2012-09-19 15:25:34 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-04 16:00:07 -0400
commit6825a26c2dc21eb4f8df9c06d3786ddec97cf53b (patch)
tree8fae2530f09c68511c32d1096cca658585b3655d /net
parent32418cfe495c95013be2e805c087db89dcefac6d (diff)
ipv6: release reference of ip6_null_entry's dst entry in __ip6_del_rt
as we hold dst_entry before we call __ip6_del_rt, so we should alse call dst_release not only return -ENOENT when the rt6_info is ip6_null_entry. and we already hold the dst entry, so I think it's safe to call dst_release out of the write-read lock. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-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