aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorPaolo Abeni <[email protected]>2024-07-02 10:06:52 +0000
committerPaolo Abeni <[email protected]>2024-07-02 10:06:52 +0000
commite2dd0d0593c17f32c7263e9d6f7554ecaabb0baf (patch)
tree49d28d7d73115a7f25d5e52cac07fda75a117dbd /net/core/skbuff.c
parentnet: phy: fix potential use of NULL pointer in phy_suspend() (diff)
parentnet: limit scope of a skb_zerocopy_iter_stream var (diff)
downloadkernel-e2dd0d0593c17f32c7263e9d6f7554ecaabb0baf.tar.gz
kernel-e2dd0d0593c17f32c7263e9d6f7554ecaabb0baf.zip
Merge branch 'zerocopy-tx-cleanups'
Pavel Begunkov says: ==================== zerocopy tx cleanups Assorted zerocopy send path cleanups, the main part of which is moving some net stack specific accounting out of io_uring back to net/ in Patch 4. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index eb9a7e65b5c8..0ed4d00d258c 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1871,7 +1871,6 @@ int skb_zerocopy_iter_stream(struct sock *sk, struct sk_buff *skb,
struct msghdr *msg, int len,
struct ubuf_info *uarg)
{
- struct ubuf_info *orig_uarg = skb_zcopy(skb);
int err, orig_len = skb->len;
if (uarg->ops->link_skb) {
@@ -1879,6 +1878,8 @@ int skb_zerocopy_iter_stream(struct sock *sk, struct sk_buff *skb,
if (err)
return err;
} else {
+ struct ubuf_info *orig_uarg = skb_zcopy(skb);
+
/* An skb can only point to one uarg. This edge case happens
* when TCP appends to an skb, but zerocopy_realloc triggered
* a new alloc.
@@ -1899,8 +1900,7 @@ int skb_zerocopy_iter_stream(struct sock *sk, struct sk_buff *skb,
return err;
}
- if (!uarg->ops->link_skb)
- skb_zcopy_set(skb, uarg, NULL);
+ skb_zcopy_set(skb, uarg, NULL);
return skb->len - orig_len;
}
EXPORT_SYMBOL_GPL(skb_zerocopy_iter_stream);