Skip to contentSkip to conversation

macvtap: convert to SKB paged frag API.

PATCH New Dan Carpenter 3 participants 3 messages Sep 20, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Ian,

There is a problem in d1b08284ade "macvtap: convert to SKB paged frag API." It removes the initialization of "f" in zerocopy_sg_from_iovec() which breaks it and causes a compile warning:
drivers/net/macvtap.c:509:5: warning: ‘f’ may be used uninitialized
in this function [-Wuninitialized]

regards,
dan carpenter

#1 lore raw
Quoted 7 lines · Dan Carpenter

Hi Ian,

There is a problem in d1b08284ade "macvtap: convert to SKB paged frag API." It removes the initialization of "f" in zerocopy_sg_from_iovec() which breaks it and causes a compile warning:
drivers/net/macvtap.c:509:5: warning: ‘f’ may be used uninitialized
in this function [-Wuninitialized]

Not just a warning but an actual bug -- I'll post a patch.

Thanks for the heads up!

Ian.

#2 lore raw

PATCH 1/1 macvtap: fix warning due to use of uninitialised var

In reply to Dan Carpenter

d1b08284ade "macvtap: convert to SKB paged frag API." accidentally dropped the initialisation of a variable leading to:
drivers/net/macvtap.c:509:5: warning: ‘f’ may be used uninitialized
in this function [-Wuninitialized]

---
 drivers/net/macvtap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/macvtap.c +1 -0
index 7c3f84a..5beda89 100644
@@ -503,6 +503,7 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
 		skb->truesize += len;
 		atomic_add(len, &skb->sk->sk_wmem_alloc);
 		while (len) {
+			f = &skb_shinfo(skb)->frags[i];
 			__skb_fill_page_desc(
 				skb, i, page[i],
 				base & ~PAGE_MASK,
Signature · 1 line
1.7.2.5