aboutsummaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-05-02 20:00:47 +0200
committerMichael S. Tsirkin <mst@redhat.com>2011-05-05 16:10:08 +0300
commit45fe15c25a5c9feea6e0f78434f5e9f632de9d94 (patch)
tree0749b7fc7f98200e3c42d213b9916be135195151 /hw/ide
parent072476ea08dcffe89b0bd6e2053f01dd89c54861 (diff)
downloadqemu-45fe15c25a5c9feea6e0f78434f5e9f632de9d94.zip
qemu-45fe15c25a5c9feea6e0f78434f5e9f632de9d94.tar.gz
qemu-45fe15c25a5c9feea6e0f78434f5e9f632de9d94.tar.bz2
MSI: Robust resource release
msi_init may fail, so we need to check on uninit if the cap was actually installed. This also avoids that the users need to check. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/ich.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index eb00f03..fd3537e 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -110,10 +110,7 @@ static int pci_ich9_uninit(PCIDevice *dev)
struct AHCIPCIState *d;
d = DO_UPCAST(struct AHCIPCIState, card, dev);
- if (msi_enabled(dev)) {
- msi_uninit(dev);
- }
-
+ msi_uninit(dev);
qemu_unregister_reset(ahci_reset, d);
ahci_uninit(&d->ahci);