Skip to content

Commit a113d04

Browse files
lulu-github-namemstsirkin
authored andcommitted
virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one()
In function kvm_virtio_pci_vector_use_one(), the function will only use the irqfd/vector for itself. Therefore, in the undo label, the failing process is incorrect. To fix this, we can just remove this label. Fixes: f9a09ca ("vhost: add support for configure interrupt") Cc: [email protected] Signed-off-by: Cindy Lu <[email protected]> Message-Id: <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 0c0cc13 commit a113d04

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

hw/virtio/virtio-pci.c

+2-16
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy *proxy, int queue_no)
898898
}
899899
ret = kvm_virtio_pci_vq_vector_use(proxy, vector);
900900
if (ret < 0) {
901-
goto undo;
901+
return ret;
902902
}
903903
/*
904904
* If guest supports masking, set up irqfd now.
@@ -908,25 +908,11 @@ static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy *proxy, int queue_no)
908908
ret = kvm_virtio_pci_irqfd_use(proxy, n, vector);
909909
if (ret < 0) {
910910
kvm_virtio_pci_vq_vector_release(proxy, vector);
911-
goto undo;
911+
return ret;
912912
}
913913
}
914914

915915
return 0;
916-
undo:
917-
918-
vector = virtio_queue_vector(vdev, queue_no);
919-
if (vector >= msix_nr_vectors_allocated(dev)) {
920-
return ret;
921-
}
922-
if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) {
923-
ret = virtio_pci_get_notifier(proxy, queue_no, &n, &vector);
924-
if (ret < 0) {
925-
return ret;
926-
}
927-
kvm_virtio_pci_irqfd_release(proxy, n, vector);
928-
}
929-
return ret;
930916
}
931917
static int kvm_virtio_pci_vector_vq_use(VirtIOPCIProxy *proxy, int nvqs)
932918
{

0 commit comments

Comments
 (0)