Merge remote-tracking branch 'master' into queue
[cascardo/linux.git] / drivers / lguest / lguest_device.c
index 9e8388e..fc92ccb 100644 (file)
@@ -263,6 +263,9 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
        struct virtqueue *vq;
        int err;
 
+       if (!name)
+               return NULL;
+
        /* We must have this many virtqueues. */
        if (index >= ldev->desc->num_vq)
                return ERR_PTR(-ENOENT);
@@ -296,7 +299,7 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
         * to 'true': the host just a(nother) SMP CPU, so we only need inter-cpu
         * barriers.
         */
-       vq = vring_new_virtqueue(lvq->config.num, LGUEST_VRING_ALIGN, vdev,
+       vq = vring_new_virtqueue(index, lvq->config.num, LGUEST_VRING_ALIGN, vdev,
                                 true, lvq->pages, lg_notify, callback, name);
        if (!vq) {
                err = -ENOMEM;