net: always try to set ubuf in skb_zerocopy_iter_stream
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 27 Jun 2024 12:59:41 +0000 (13:59 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 2 Jul 2024 10:06:50 +0000 (12:06 +0200)
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 <asml.silence@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/core/skbuff.c

index eb9a7e65b5c818ab04ff7bcc042f25e2b45fbaa8..52986e1ce13ecded07d99f3a7a9ca9cfb5a9f6d6 100644 (file)
@@ -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);