Browse Source

ipv6: release idev when ip6_neigh_lookup failed in icmp6_dst_alloc

release idev when ip6_neigh_lookup failed in icmp6_dst_alloc

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
RongQing.Li 13 năm trước cách đây
mục cha
commit
252c3d84ed
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      net/ipv6/route.c

+ 1 - 0
net/ipv6/route.c

@@ -1091,6 +1091,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
 	else {
 		neigh = ip6_neigh_lookup(&rt->dst, &fl6->daddr);
 		if (IS_ERR(neigh)) {
+			in6_dev_put(idev);
 			dst_free(&rt->dst);
 			return ERR_CAST(neigh);
 		}