summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_output.c
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2018-12-08 12:22:46 +0100
committerDavid S. Miller <davem@davemloft.net>2018-12-08 21:26:20 +0100
commit97ef7b4c5501b081c6144a08bba6d87baf69b6e5 (patch)
tree0162a188876cd854112e5416d63f79c95721bd46 /net/ipv6/ip6_output.c
parentMerge branch 'tc-testing-next' (diff)
downloadlinux-97ef7b4c5501b081c6144a08bba6d87baf69b6e5.tar.xz
linux-97ef7b4c5501b081c6144a08bba6d87baf69b6e5.zip
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: 52900d22288e ("udp: elide zerocopy operation in hot path") Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r--net/ipv6/ip6_output.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 6592a39e5ec1..be25b34dc5c2 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1575,7 +1575,8 @@ alloc_new_skb:
error_efault:
err = -EFAULT;
error:
- sock_zerocopy_put_abort(uarg, extra_uref);
+ if (uarg)
+ sock_zerocopy_put_abort(uarg, extra_uref);
cork->length -= length;
IP6_INC_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS);
refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc);