提交 4d125de3 编写于 作者: R Rusty Russell

virtio: more fallout from scatterlist changes.

This fixes OOPS in network driver when CONFIG_DEBUG_SG=y.
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 44332f71
...@@ -146,6 +146,7 @@ static void try_fill_recv(struct virtnet_info *vi) ...@@ -146,6 +146,7 @@ static void try_fill_recv(struct virtnet_info *vi)
struct scatterlist sg[1+MAX_SKB_FRAGS]; struct scatterlist sg[1+MAX_SKB_FRAGS];
int num, err; int num, err;
sg_init_table(sg, 1+MAX_SKB_FRAGS);
for (;;) { for (;;) {
skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN); skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN);
if (unlikely(!skb)) if (unlikely(!skb))
...@@ -231,6 +232,8 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -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; const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
DECLARE_MAC_BUF(mac); 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)); pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest));
free_old_xmit_skbs(vi); free_old_xmit_skbs(vi);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册