Skip to content

Commit

Permalink
net: always try to set ubuf in skb_zerocopy_iter_stream
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Begunkov authored and Paolo Abeni committed Jul 2, 2024
1 parent 19e6ad2 commit 9e2db9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9e2db9d

Please sign in to comment.