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

Commit 2aab9525 authored by Mahesh Bandewar's avatar Mahesh Bandewar Committed by David S. Miller
Browse files

ipvlan: fix incorrect usage of IS_ERR() macro in IPv6 code path.



The ip6_route_output() always returns a valid dst pointer unlike in IPv4
case. So the validation has to be different from the IPv4 path. Correcting
that error in this patch.

This was picked up by a static checker with a following warning -

   drivers/net/ipvlan/ipvlan_core.c:380 ipvlan_process_v6_outbound()
        warn: 'dst' isn't an ERR_PTR

Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6b8d9117
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -377,9 +377,11 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
	};
	};


	dst = ip6_route_output(dev_net(dev), NULL, &fl6);
	dst = ip6_route_output(dev_net(dev), NULL, &fl6);
	if (IS_ERR(dst))
	if (dst->error) {
		ret = dst->error;
		dst_release(dst);
		goto err;
		goto err;

	}
	skb_dst_drop(skb);
	skb_dst_drop(skb);
	skb_dst_set(skb, dst);
	skb_dst_set(skb, dst);
	err = ip6_local_out(skb);
	err = ip6_local_out(skb);