Skip to content

Commit

Permalink
KVM: fix assigned_device_enable_host_msix error handling
Browse files Browse the repository at this point in the history
Free IRQ's and disable MSIX upon failure.

Cc: Avi Kivity <[email protected]>
Signed-off-by: Jing Zhang <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
jing zhang authored and avikivity committed May 17, 2010
1 parent a87fa35 commit d57e2c0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions virt/kvm/assigned-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,16 @@ static int assigned_device_enable_host_msix(struct kvm *kvm,
kvm_assigned_dev_intr, 0,
"kvm_assigned_msix_device",
(void *)dev);
/* FIXME: free requested_irq's on failure */
if (r)
return r;
goto err;
}

return 0;
err:
for (i -= 1; i >= 0; i--)
free_irq(dev->host_msix_entries[i].vector, (void *)dev);
pci_disable_msix(dev->dev);
return r;
}

#endif
Expand Down

0 comments on commit d57e2c0

Please sign in to comment.