diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-02-04 02:36:16 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-02-04 02:36:16 +0100 |
commit | c59400a68c53374179cdc5f99fa77afbd092dcf8 (patch) | |
tree | c5e17286fa5b7867a5290a975cca3bc5759d510e /net/ipv4/tcp.c | |
parent | Merge branch 'dsa-mv88e6xxx-phylink_generic_validate' (diff) | |
parent | gcc-plugins/stackleak: Use noinstr in favor of notrace (diff) | |
download | linux-c59400a68c53374179cdc5f99fa77afbd092dcf8.tar.xz linux-c59400a68c53374179cdc5f99fa77afbd092dcf8.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index cf1ce81663b1..a03a6bfb4353 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1321,10 +1321,13 @@ new_segment: /* skb changing from pure zc to mixed, must charge zc */ if (unlikely(skb_zcopy_pure(skb))) { - if (!sk_wmem_schedule(sk, skb->data_len)) + u32 extra = skb->truesize - + SKB_TRUESIZE(skb_end_offset(skb)); + + if (!sk_wmem_schedule(sk, extra)) goto wait_for_space; - sk_mem_charge(sk, skb->data_len); + sk_mem_charge(sk, extra); skb_shinfo(skb)->flags &= ~SKBFL_PURE_ZEROCOPY; } |