Merge tag 'rproc-v5.1' of git://github.com/andersson/remoteproc
[sfrench/cifs-2.6.git] / drivers / remoteproc / remoteproc_virtio.c
index e3f67afe81717db68c87265b9df7d00f5942edd9..44774de6f17b067c15540ecc67a3d86db77eb435 100644 (file)
@@ -155,10 +155,15 @@ static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
                                 const bool * ctx,
                                 struct irq_affinity *desc)
 {
-       int i, ret;
+       int i, ret, queue_idx = 0;
 
        for (i = 0; i < nvqs; ++i) {
-               vqs[i] = rp_find_vq(vdev, i, callbacks[i], names[i],
+               if (!names[i]) {
+                       vqs[i] = NULL;
+                       continue;
+               }
+
+               vqs[i] = rp_find_vq(vdev, queue_idx++, callbacks[i], names[i],
                                    ctx ? ctx[i] : false);
                if (IS_ERR(vqs[i])) {
                        ret = PTR_ERR(vqs[i]);