diff options
Diffstat (limited to 'drivers/virtio/virtio_pci_common.c')
| -rw-r--r-- | drivers/virtio/virtio_pci_common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 465a6f5142cc..d0584c040c60 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c | |||
| @@ -285,7 +285,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs, | |||
| 285 | { | 285 | { |
| 286 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); | 286 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); |
| 287 | u16 msix_vec; | 287 | u16 msix_vec; |
| 288 | int i, err, nvectors, allocated_vectors; | 288 | int i, err, nvectors, allocated_vectors, queue_idx = 0; |
| 289 | 289 | ||
| 290 | vp_dev->vqs = kcalloc(nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL); | 290 | vp_dev->vqs = kcalloc(nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL); |
| 291 | if (!vp_dev->vqs) | 291 | if (!vp_dev->vqs) |
| @@ -321,7 +321,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs, | |||
| 321 | msix_vec = allocated_vectors++; | 321 | msix_vec = allocated_vectors++; |
| 322 | else | 322 | else |
| 323 | msix_vec = VP_MSIX_VQ_VECTOR; | 323 | msix_vec = VP_MSIX_VQ_VECTOR; |
| 324 | vqs[i] = vp_setup_vq(vdev, i, callbacks[i], names[i], | 324 | vqs[i] = vp_setup_vq(vdev, queue_idx++, callbacks[i], names[i], |
| 325 | ctx ? ctx[i] : false, | 325 | ctx ? ctx[i] : false, |
| 326 | msix_vec); | 326 | msix_vec); |
| 327 | if (IS_ERR(vqs[i])) { | 327 | if (IS_ERR(vqs[i])) { |
| @@ -356,7 +356,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned nvqs, | |||
| 356 | const char * const names[], const bool *ctx) | 356 | const char * const names[], const bool *ctx) |
| 357 | { | 357 | { |
| 358 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); | 358 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); |
| 359 | int i, err; | 359 | int i, err, queue_idx = 0; |
| 360 | 360 | ||
| 361 | vp_dev->vqs = kcalloc(nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL); | 361 | vp_dev->vqs = kcalloc(nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL); |
| 362 | if (!vp_dev->vqs) | 362 | if (!vp_dev->vqs) |
| @@ -374,7 +374,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned nvqs, | |||
| 374 | vqs[i] = NULL; | 374 | vqs[i] = NULL; |
| 375 | continue; | 375 | continue; |
| 376 | } | 376 | } |
| 377 | vqs[i] = vp_setup_vq(vdev, i, callbacks[i], names[i], | 377 | vqs[i] = vp_setup_vq(vdev, queue_idx++, callbacks[i], names[i], |
| 378 | ctx ? ctx[i] : false, | 378 | ctx ? ctx[i] : false, |
| 379 | VIRTIO_MSI_NO_VECTOR); | 379 | VIRTIO_MSI_NO_VECTOR); |
| 380 | if (IS_ERR(vqs[i])) { | 380 | if (IS_ERR(vqs[i])) { |
