Commit 653fc915 authored by Jason Wang's avatar Jason Wang Committed by David S. Miller

macvtap: fix the uninitialized var using in macvtap_alloc_skb()

Commit d1b08284 use new frag API but would leave f to be used
uninitialized, this patch fix it.
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 59da45c4
...@@ -453,7 +453,6 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, ...@@ -453,7 +453,6 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
int copy = skb_headlen(skb); int copy = skb_headlen(skb);
int size, offset1 = 0; int size, offset1 = 0;
int i = 0; int i = 0;
skb_frag_t *f;
/* Skip over from offset */ /* Skip over from offset */
while (count && (offset >= from->iov_len)) { while (count && (offset >= from->iov_len)) {
...@@ -503,14 +502,13 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, ...@@ -503,14 +502,13 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
skb->truesize += len; skb->truesize += len;
atomic_add(len, &skb->sk->sk_wmem_alloc); atomic_add(len, &skb->sk->sk_wmem_alloc);
while (len) { while (len) {
__skb_fill_page_desc( int off = base & ~PAGE_MASK;
skb, i, page[i], int size = min_t(int, len, PAGE_SIZE - off);
base & ~PAGE_MASK, __skb_fill_page_desc(skb, i, page[i], off, size);
min_t(int, len, PAGE_SIZE - f->page_offset));
skb_shinfo(skb)->nr_frags++; skb_shinfo(skb)->nr_frags++;
/* increase sk_wmem_alloc */ /* increase sk_wmem_alloc */
base += f->size; base += size;
len -= f->size; len -= size;
i++; i++;
} }
offset1 = 0; offset1 = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment