diff options
| author | Willem de Bruijn <willemb@google.com> | 2018-12-08 06:22:46 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-12-08 15:26:20 -0500 |
| commit | 97ef7b4c5501b081c6144a08bba6d87baf69b6e5 (patch) | |
| tree | 0162a188876cd854112e5416d63f79c95721bd46 /net/ipv4/ip_output.c | |
| parent | 83af01ba1c2d38d3075b38af2a2116eb1ebe67e6 (diff) | |
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/ipv4/ip_output.c')
| -rw-r--r-- | net/ipv4/ip_output.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 78f028bdad30..ab6618036afe 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
| @@ -1130,7 +1130,8 @@ alloc_new_skb: | |||
| 1130 | error_efault: | 1130 | error_efault: |
| 1131 | err = -EFAULT; | 1131 | err = -EFAULT; |
| 1132 | error: | 1132 | error: |
| 1133 | sock_zerocopy_put_abort(uarg, extra_uref); | 1133 | if (uarg) |
| 1134 | sock_zerocopy_put_abort(uarg, extra_uref); | ||
| 1134 | cork->length -= length; | 1135 | cork->length -= length; |
| 1135 | IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS); | 1136 | IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS); |
| 1136 | refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc); | 1137 | refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc); |
