mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
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>
This commit is contained in:
parent
072476ea08
commit
45fe15c25a
3 changed files with 12 additions and 9 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue