From: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx> Unlock @obj in case of an error too. Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxxxxxxx> Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx> Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx> --- src/node_device/node_device_driver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index 002c7616f..74507c214 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -282,7 +282,7 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn, STREQ(cap->data.scsi_host.wwpn, wwpn)) { if (virNodeDeviceLookupSCSIHostByWWNEnsureACL(conn, obj->def) < 0) - goto out; + goto error; if ((dev = virGetNodeDevice(conn, obj->def->name))) { if (VIR_STRDUP(dev->parent, obj->def->parent) < 0) @@ -302,6 +302,10 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn, out: nodeDeviceUnlock(); return dev; + + error: + virNodeDeviceObjUnlock(obj); + goto out; } -- 2.11.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list