Commit 97ef7b4c authored by Willem de Bruijn's avatar Willem de Bruijn Committed by David S. Miller
Browse files

ip: silence udp zerocopy smatch false positive



extra_uref is used in __ip(6)_append_data only if uarg is set.

Smatch sees that the variable is passed to sock_zerocopy_put_abort.
This function accesses it only when uarg is set, but smatch cannot
infer this.

Make this dependency explicit.

Fixes: 52900d22 ("udp: elide zerocopy operation in hot path")
Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 83af01ba
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1130,6 +1130,7 @@ alloc_new_skb:
error_efault:
	err = -EFAULT;
error:
	if (uarg)
		sock_zerocopy_put_abort(uarg, extra_uref);
	cork->length -= length;
	IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS);
+2 −1
Original line number Diff line number Diff line
@@ -1575,6 +1575,7 @@ alloc_new_skb:
error_efault:
	err = -EFAULT;
error:
	if (uarg)
		sock_zerocopy_put_abort(uarg, extra_uref);
	cork->length -= length;
	IP6_INC_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS);