virtio_net: missing sg_init_table

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Tuesday, April 13, 2010 - 12:59 pm

Gitweb:     http://git.kernel.org/linus/0e413f22e4c1cbfe12907e462a7d739a2e316f2b
Commit:     0e413f22e4c1cbfe12907e462a7d739a2e316f2b
Parent:     4a1032faac94ebbf647460ae3e06fc21146eb280
Author:     Shirley Ma <mashirle@us.ibm.com>
AuthorDate: Mon Mar 29 15:19:15 2010 +0000
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Mon Apr 12 22:00:34 2010 -0700

    virtio_net: missing sg_init_table
    
    Add missing sg_init_table for sg_set_buf in virtio_net which
    induced in defer skb patch.
    
    Reported-by: Thomas Müller <thomas@mathtm.de>
    Tested-by: Thomas Müller <thomas@mathtm.de>
    Signed-off-by: Shirley Ma <xma@us.ibm.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 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 6fb783c..b0577dd 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -327,6 +327,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;
@@ -352,6 +353,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);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
virtio_net: missing sg_init_table, Linux Kernel Mailing ..., (Tue Apr 13, 12:59 pm)