}
cleanup:
+ virObjectUnref(pcidevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
- virObjectUnref(pcidevs);
+
return ret;
}
virObjectLock(hostdev_mgr->inactivePCIHostdevs);
if (virHostdevIsPCINodeDeviceUsed(virPCIDeviceGetAddress(pci), &data))
- goto out;
+ goto cleanup;
if (virPCIDeviceDetach(pci, hostdev_mgr->activePCIHostdevs,
- hostdev_mgr->inactivePCIHostdevs) < 0) {
- goto out;
- }
+ hostdev_mgr->inactivePCIHostdevs) < 0)
+ goto cleanup;
ret = 0;
- out:
+
+ cleanup:
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
+
return ret;
}
virObjectLock(hostdev_mgr->inactivePCIHostdevs);
if (virHostdevIsPCINodeDeviceUsed(virPCIDeviceGetAddress(pci), &data))
- goto out;
+ goto cleanup;
virPCIDeviceSetUnbindFromStub(pci, true);
virPCIDeviceSetRemoveSlot(pci, true);
if (virPCIDeviceReattach(pci, hostdev_mgr->activePCIHostdevs,
hostdev_mgr->inactivePCIHostdevs) < 0)
- goto out;
+ goto cleanup;
ret = 0;
- out:
+
+ cleanup:
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
+
return ret;
}