summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-02-04 02:36:16 +0100
committerJakub Kicinski <kuba@kernel.org>2022-02-04 02:36:16 +0100
commitc59400a68c53374179cdc5f99fa77afbd092dcf8 (patch)
treec5e17286fa5b7867a5290a975cca3bc5759d510e /net/ipv4/tcp.c
parentMerge branch 'dsa-mv88e6xxx-phylink_generic_validate' (diff)
parentgcc-plugins/stackleak: Use noinstr in favor of notrace (diff)
downloadlinux-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.c7
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;
}