1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-10 05:17:59 +03:00

Use virNWFilterBindingObjEndAPI() more

Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj)
combo the virNWFilterBindingObjEndAPI() can be used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Michal Privoznik 2021-11-10 09:57:42 +01:00
parent c6edab9d5d
commit 375fb7d576

View File

@ -114,11 +114,8 @@ virNWFilterBindingObjListFindByPortDev(virNWFilterBindingObjList *bindings,
obj = virNWFilterBindingObjListFindByPortDevLocked(bindings, name);
virObjectRWUnlock(bindings);
if (obj && virNWFilterBindingObjGetRemoving(obj)) {
virObjectUnlock(obj);
virObjectUnref(obj);
obj = NULL;
}
if (obj && virNWFilterBindingObjGetRemoving(obj))
virNWFilterBindingObjEndAPI(&obj);
return obj;
}
@ -407,8 +404,7 @@ virNWFilterBindingObjListFilter(virNWFilterBindingObj ***list,
*/
if (virNWFilterBindingObjGetRemoving(binding) ||
(filter && !filter(conn, def))) {
virObjectUnlock(binding);
virObjectUnref(binding);
virNWFilterBindingObjEndAPI(&binding);
VIR_DELETE_ELEMENT(*list, i, *nbindings);
continue;
}