summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2012-09-19 19:25:34 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-13 05:38:43 +0900
commit17de307472bf21479e6d7c35211204b6ea186a7c (patch)
treee90915dc70367e2252e35f2af7a9aeea992ceb30 /net
parent2ab08687cf48805c5abd0f9a785e09181eda9492 (diff)
downloadlinux-3.10-17de307472bf21479e6d7c35211204b6ea186a7c.tar.gz
linux-3.10-17de307472bf21479e6d7c35211204b6ea186a7c.tar.bz2
linux-3.10-17de307472bf21479e6d7c35211204b6ea186a7c.zip
ipv6: release reference of ip6_null_entry's dst entry in __ip6_del_rt
[ Upstream commit 6825a26c2dc21eb4f8df9c06d3786ddec97cf53b ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 c4920ca83f5..2796b374cb2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1485,17 +1485,18 @@ static int __ip6_del_rt(struct rt6_info *rt, struct nl_info *info)
struct fib6_table *table;
struct net *net = dev_net(rt->dst.dev);
- if (rt == net->ipv6.ip6_null_entry)
- return -ENOENT;
+ if (rt == net->ipv6.ip6_null_entry) {
+ err = -ENOENT;
+ goto out;
+ }
table = rt->rt6i_table;
write_lock_bh(&table->tb6_lock);
-
err = fib6_del(rt, info);
- dst_release(&rt->dst);
-
write_unlock_bh(&table->tb6_lock);
+out:
+ dst_release(&rt->dst);
return err;
}