diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 25dc77ccbf58..ecec9a8527f3 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); |
@@ -719,7 +721,6 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
719 | struct scatterlist sg[2]; | 721 | struct scatterlist sg[2]; |
720 | u8 promisc, allmulti; | 722 | u8 promisc, allmulti; |
721 | struct virtio_net_ctrl_mac *mac_data; | 723 | struct virtio_net_ctrl_mac *mac_data; |
722 | struct dev_addr_list *addr; | ||
723 | struct netdev_hw_addr *ha; | 724 | struct netdev_hw_addr *ha; |
724 | int uc_count; | 725 | int uc_count; |
725 | int mc_count; | 726 | int mc_count; |
@@ -776,8 +777,8 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
776 | 777 | ||
777 | mac_data->entries = mc_count; | 778 | mac_data->entries = mc_count; |
778 | i = 0; | 779 | i = 0; |
779 | netdev_for_each_mc_addr(addr, dev) | 780 | netdev_for_each_mc_addr(ha, dev) |
780 | memcpy(&mac_data->macs[i++][0], addr->da_addr, ETH_ALEN); | 781 | memcpy(&mac_data->macs[i++][0], ha->addr, ETH_ALEN); |
781 | 782 | ||
782 | sg_set_buf(&sg[1], mac_data, | 783 | sg_set_buf(&sg[1], mac_data, |
783 | sizeof(mac_data->entries) + (mc_count * ETH_ALEN)); | 784 | sizeof(mac_data->entries) + (mc_count * ETH_ALEN)); |