mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
net: limit scope of a skb_zerocopy_iter_stream var
skb_zerocopy_iter_stream() only uses @orig_uarg in the !link_skb path, and we can move the local variable in the appropriate block. 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>
This commit is contained in:
parent
060f4ba6e4
commit
2ca58ed21c
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user