Commit 9e2db9d3 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Paolo Abeni
Browse files

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: default avatarPavel Begunkov <asml.silence@gmail.com>
Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 19e6ad2c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1899,7 +1899,6 @@ 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);
	return skb->len - orig_len;
}