]> err.no Git - linux-2.6/commitdiff
virtio: more fallout from scatterlist changes.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 7 Nov 2007 05:34:49 +0000 (16:34 +1100)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 12 Nov 2007 02:55:25 +0000 (13:55 +1100)
This fixes OOPS in network driver when CONFIG_DEBUG_SG=y.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/net/virtio_net.c

index e396c9d2af8d8a1aa9b9ca3d8b59a3577de7665f..a75be57fb2097374f0af1e69cc371f6559d8fbdc 100644 (file)
@@ -146,6 +146,7 @@ static void try_fill_recv(struct virtnet_info *vi)
        struct scatterlist sg[1+MAX_SKB_FRAGS];
        int num, err;
 
+       sg_init_table(sg, 1+MAX_SKB_FRAGS);
        for (;;) {
                skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN);
                if (unlikely(!skb))
@@ -231,6 +232,8 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
        const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
        DECLARE_MAC_BUF(mac);
 
+       sg_init_table(sg, 1+MAX_SKB_FRAGS);
+
        pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest));
 
        free_old_xmit_skbs(vi);