]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ipv6: ip6_route_output() never returns NULL.
authorRongQing.Li <roy.qing.li@gmail.com>
Tue, 21 Feb 2012 22:10:49 +0000 (22:10 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Feb 2012 20:30:14 +0000 (15:30 -0500)
ip6_route_output() never returns NULL, so it is wrong to
check if the return value is NULL.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6mr.c
net/ipv6/ndisc.c

index c7e95c8c579f6e71848e3857d18392e5983199c3..5aa3981a392273891881ea8defc1d70fff7adde4 100644 (file)
@@ -1926,8 +1926,10 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt,
        };
 
        dst = ip6_route_output(net, NULL, &fl6);
-       if (!dst)
+       if (dst->error) {
+               dst_release(dst);
                goto out_free;
+       }
 
        skb_dst_drop(skb);
        skb_dst_set(skb, dst);
index d8f02ef88e59b265322890025aa22e51815abb3a..c964958ac470f65408c09642814a532205fa497c 100644 (file)
@@ -1545,9 +1545,10 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
                         &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex);
 
        dst = ip6_route_output(net, NULL, &fl6);
-       if (dst == NULL)
+       if (dst->error) {
+               dst_release(dst);
                return;
-
+       }
        dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
        if (IS_ERR(dst))
                return;