netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next-next-2.6] virtio_net: missing sg_init_table
@ 2010-03-29 18:31 Shirley Ma
  2010-03-29 19:31 ` Thomas Müller
  0 siblings, 1 reply; 10+ messages in thread
From: Shirley Ma @ 2010-03-29 18:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel, Thomas Müller

Add missing sg_init_table for sg_set_buf in virtio_net.

Reported-by: Thomas Müller <thomas@mathtm.de>
Signed-off-by: Shirley Ma <xma@us.ibm.com>

---
 drivers/net/virtio_net.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 25dc77c..3f5be35 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -326,6 +326,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp)
 	struct scatterlist sg[2];
 	int err;
 
+	sg_init_table(sg, 2);
 	skb = netdev_alloc_skb_ip_align(vi->dev, MAX_PACKET_LEN);
 	if (unlikely(!skb))
 		return -ENOMEM;
@@ -351,6 +352,7 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp)
 	char *p;
 	int i, err, offset;
 
+	sg_init_table(sg, MAX_SKB_FRAGS + 2);
 	/* page in sg[MAX_SKB_FRAGS + 1] is list tail */
 	for (i = MAX_SKB_FRAGS + 1; i > 1; --i) {
 		first = get_a_page(vi, gfp);

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-04-06  3:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-29 18:31 [PATCH next-next-2.6] virtio_net: missing sg_init_table Shirley Ma
2010-03-29 19:31 ` Thomas Müller
2010-03-30  1:19   ` [PATCH next-next-2.6 v2] " Shirley Ma
2010-03-31  1:32     ` David Miller
2010-03-31  9:20     ` Michael S. Tsirkin
2010-03-31 10:16       ` David Miller
2010-03-31 12:41         ` [PATCH] virtio-net: move sg off stack Michael S. Tsirkin
     [not found]         ` <20100331124156.GA4598@redhat.com>
2010-04-02  2:26           ` David Miller
2010-04-06  3:14             ` Rusty Russell
2010-03-30  1:19   ` [PATCH next-next-2.6] virtio_net: missing sg_init_table Shirley Ma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).