From: Pavel Begunkov Date: Thu, 27 Jun 2024 12:59:41 +0000 (+0100) Subject: net: always try to set ubuf in skb_zerocopy_iter_stream X-Git-Tag: v6.11-rc1~163^2~107^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e2db9d3993e270b24fbc4ce1ca7e09756e8df25;p=thirdparty%2Flinux.git net: always try to set ubuf in skb_zerocopy_iter_stream skb_zcopy_set() does nothing if there is already a ubuf_info associated with an skb, and since ->link_skb should have set it several lines above the check here essentially does nothing and can be removed. It's also safer this way, because even if the callback is faulty we'll have it set. Signed-off-by: Pavel Begunkov Reviewed-by: Willem de Bruijn Reviewed-by: Jens Axboe Signed-off-by: Paolo Abeni --- diff --git a/net/core/skbuff.c b/net/core/skbuff.c index eb9a7e65b5c81..52986e1ce13ec 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1899,8 +1899,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);