mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
node_device: Unlock obj in case of an error too
Unlock @obj in case of an error too. Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
This commit is contained in:
parent
3e69217953
commit
a9b98ecf4e
@ -284,7 +284,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) {
|
||||
@ -306,6 +306,10 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn,
|
||||
out:
|
||||
nodeDeviceUnlock();
|
||||
return dev;
|
||||
|
||||
error:
|
||||
virNodeDeviceObjUnlock(obj);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user