ipv6: introduce ip6_rt_put()
As suggested by Eric, we could introduce a helper function for ipv6 too, to avoid checking if rt is NULL before dst_release(). Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
6da025fa23
commit
94e187c015
@@ -163,7 +163,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
|
||||
rt = rt6_lookup(net, addr, NULL, 0, 0);
|
||||
if (rt) {
|
||||
dev = rt->dst.dev;
|
||||
dst_release(&rt->dst);
|
||||
ip6_rt_put(rt);
|
||||
}
|
||||
} else
|
||||
dev = dev_get_by_index_rcu(net, ifindex);
|
||||
@@ -260,7 +260,7 @@ static struct inet6_dev *ip6_mc_find_dev_rcu(struct net *net,
|
||||
|
||||
if (rt) {
|
||||
dev = rt->dst.dev;
|
||||
dst_release(&rt->dst);
|
||||
ip6_rt_put(rt);
|
||||
}
|
||||
} else
|
||||
dev = dev_get_by_index_rcu(net, ifindex);
|
||||
|
Reference in New Issue
Block a user