aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorShirley Ma <mashirle@us.ibm.com>2010-03-29 11:19:15 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-30 21:31:59 -0400
commit2c45cd43ff791cc4ab6a6332165ad53d7bcb3673 (patch)
tree5032ed32e2e9768a62ecd4776559037440bf87ae /drivers/net/virtio_net.c
parent36c0d8cca3283c235c9af1954de641df84c80f0f (diff)
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>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 25dc77ccbf58..3f5be35dea25 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)
326 struct scatterlist sg[2]; 326 struct scatterlist sg[2];
327 int err; 327 int err;
328 328
329 sg_init_table(sg, 2);
329 skb = netdev_alloc_skb_ip_align(vi->dev, MAX_PACKET_LEN); 330 skb = netdev_alloc_skb_ip_align(vi->dev, MAX_PACKET_LEN);
330 if (unlikely(!skb)) 331 if (unlikely(!skb))
331 return -ENOMEM; 332 return -ENOMEM;
@@ -351,6 +352,7 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp)
351 char *p; 352 char *p;
352 int i, err, offset; 353 int i, err, offset;
353 354
355 sg_init_table(sg, MAX_SKB_FRAGS + 2);
354 /* page in sg[MAX_SKB_FRAGS + 1] is list tail */ 356 /* page in sg[MAX_SKB_FRAGS + 1] is list tail */
355 for (i = MAX_SKB_FRAGS + 1; i > 1; --i) { 357 for (i = MAX_SKB_FRAGS + 1; i > 1; --i) {
356 first = get_a_page(vi, gfp); 358 first = get_a_page(vi, gfp);