Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5095d64d authored by RongQing.Li's avatar RongQing.Li Committed by David S. Miller
Browse files

ipv6: ip6_route_output() never returns NULL.



ip6_route_output() never returns NULL, so it is wrong to
check if the return value is NULL.

Signed-off-by: default avatarRongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ba9adbe6
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1926,8 +1926,10 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt,
	};
	};


	dst = ip6_route_output(net, NULL, &fl6);
	dst = ip6_route_output(net, NULL, &fl6);
	if (!dst)
	if (dst->error) {
		dst_release(dst);
		goto out_free;
		goto out_free;
	}


	skb_dst_drop(skb);
	skb_dst_drop(skb);
	skb_dst_set(skb, dst);
	skb_dst_set(skb, dst);
+3 −2
Original line number Original line Diff line number Diff line
@@ -1545,9 +1545,10 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
			 &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex);
			 &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex);


	dst = ip6_route_output(net, NULL, &fl6);
	dst = ip6_route_output(net, NULL, &fl6);
	if (dst == NULL)
	if (dst->error) {
		dst_release(dst);
		return;
		return;

	}
	dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
	dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
	if (IS_ERR(dst))
	if (IS_ERR(dst))
		return;
		return;