From dad0ae1c1f43dfa9e67a660ec9bfad1788f39d1a Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Mon, 25 Jan 2016 14:24:50 +0100 Subject: hostdev: Minor style adjustments Mostly labels names and whitespace. No functional changes. --- src/util/virhostdev.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 76c0429486..9ae217dfdb 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -747,9 +747,10 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr, } cleanup: + virObjectUnref(pcidevs); virObjectUnlock(hostdev_mgr->activePCIHostdevs); virObjectUnlock(hostdev_mgr->inactivePCIHostdevs); - virObjectUnref(pcidevs); + return ret; } @@ -1591,17 +1592,18 @@ virHostdevPCINodeDeviceDetach(virHostdevManagerPtr hostdev_mgr, 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; } @@ -1617,7 +1619,7 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr, virObjectLock(hostdev_mgr->inactivePCIHostdevs); if (virHostdevIsPCINodeDeviceUsed(virPCIDeviceGetAddress(pci), &data)) - goto out; + goto cleanup; virPCIDeviceSetUnbindFromStub(pci, true); virPCIDeviceSetRemoveSlot(pci, true); @@ -1625,12 +1627,14 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr hostdev_mgr, 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; } -- cgit v1.2.1