node_device_driver: Use automatic mutex management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2022-03-22 17:47:44 +01:00
parent 1e4d85af32
commit 29bb566a22

View File

@ -1072,14 +1072,10 @@ static bool
matchDeviceAddress(virNodeDeviceObj *obj,
const void *opaque)
{
g_autofree char *addr = NULL;
bool want = false;
VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
g_autofree char *addr = nodeDeviceObjFormatAddress(obj);
virObjectLock(obj);
addr = nodeDeviceObjFormatAddress(obj);
want = STREQ_NULLABLE(addr, opaque);
virObjectUnlock(obj);
return want;
return STREQ_NULLABLE(addr, opaque);
}