net/mlx4_core: Fix smatch error - possible access to a null variable
[deliverable/linux.git] / drivers / net / virtio_net.c
index 8a852b5f215f1c5b3b42c3bc93cf6655a1178b68..7d9f84a91f37dd96fbd835d170dc8ed24c281b6c 100644 (file)
@@ -1646,7 +1646,7 @@ static int virtnet_probe(struct virtio_device *vdev)
        dev->netdev_ops = &virtnet_netdev;
        dev->features = NETIF_F_HIGHDMA;
 
-       SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops);
+       dev->ethtool_ops = &virtnet_ethtool_ops;
        SET_NETDEV_DEV(dev, &vdev->dev);
 
        /* Do we support "hardware" checksums? */
@@ -1724,6 +1724,13 @@ static int virtnet_probe(struct virtio_device *vdev)
        if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ))
                vi->has_cvq = true;
 
+       if (vi->any_header_sg) {
+               if (vi->mergeable_rx_bufs)
+                       dev->needed_headroom = sizeof(struct virtio_net_hdr_mrg_rxbuf);
+               else
+                       dev->needed_headroom = sizeof(struct virtio_net_hdr);
+       }
+
        /* Use single tx/rx queue pair as default */
        vi->curr_queue_pairs = 1;
        vi->max_queue_pairs = max_queue_pairs;
This page took 0.025199 seconds and 5 git commands to generate.