Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj)
combo the virNodeDeviceObjEndAPI() can be used.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/virnodedeviceobj.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index 165ec1f1dd..15898a6aa7 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -524,8 +524,7 @@ virNodeDeviceObjListRemove(virNodeDeviceObjList *devs,
virObjectRWLockWrite(devs);
virObjectLock(obj);
virNodeDeviceObjListRemoveLocked(devs, obj);
- virObjectUnlock(obj);
- virObjectUnref(obj);
+ virNodeDeviceObjEndAPI(&obj);
virObjectRWUnlock(devs);
}
--
2.32.0