summaryrefslogtreecommitdiff
path: root/include/net/sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 577d91fb5626..7fa223278522 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1465,13 +1465,14 @@ static inline void sk_mem_uncharge(struct sock *sk, int size)
static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
{
+ sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
+ sk->sk_wmem_queued -= skb->truesize;
+ sk_mem_uncharge(sk, skb->truesize);
if (!sk->sk_tx_skb_cache) {
+ skb_zcopy_clear(skb, true);
sk->sk_tx_skb_cache = skb;
return;
}
- sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
- sk->sk_wmem_queued -= skb->truesize;
- sk_mem_uncharge(sk, skb->truesize);
__kfree_skb(skb);
}