aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorAmerigo Wang <amwang@redhat.com>2012-10-28 20:13:19 -0400
committerDavid S. Miller <davem@davemloft.net>2012-11-03 14:59:05 -0400
commit94e187c01512c9cf29e2ff54bf1a1b045f38293d (patch)
tree2149f4652fb0fc997ce5728f9574e1ab5351f0e5 /net/ipv6/addrconf.c
parent6da025fa23bb10c82f80de319c837ed2b02306e4 (diff)
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>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index ced58e1d91b6..fab23db8ee73 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -699,7 +699,7 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp)
699 pr_warn("Freeing alive inet6 address %p\n", ifp); 699 pr_warn("Freeing alive inet6 address %p\n", ifp);
700 return; 700 return;
701 } 701 }
702 dst_release(&ifp->rt->dst); 702 ip6_rt_put(ifp->rt);
703 703
704 kfree_rcu(ifp, rcu); 704 kfree_rcu(ifp, rcu);
705} 705}
@@ -951,7 +951,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
951 rt6_set_expires(rt, expires); 951 rt6_set_expires(rt, expires);
952 } 952 }
953 } 953 }
954 dst_release(&rt->dst); 954 ip6_rt_put(rt);
955 } 955 }
956 956
957 /* clean up prefsrc entries */ 957 /* clean up prefsrc entries */
@@ -2027,8 +2027,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
2027 addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len, 2027 addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len,
2028 dev, expires, flags); 2028 dev, expires, flags);
2029 } 2029 }
2030 if (rt) 2030 ip6_rt_put(rt);
2031 dst_release(&rt->dst);
2032 } 2031 }
2033 2032
2034 /* Try to figure out our local address for this prefix */ 2033 /* Try to figure out our local address for this prefix */