nodedev: Add check for NULL obj before call Unlock

Commit id '95ea171b' was a bit too aggressive in removing the if (obj)
check since cleanup is reachable after Unlock and obj = NULL.
This commit is contained in:
John Ferlan 2017-06-28 06:54:05 -04:00
parent b183f17d76
commit 045b75c515
1 changed files with 2 additions and 1 deletions

View File

@ -650,7 +650,8 @@ nodeDeviceDestroy(virNodeDevicePtr dev)
cleanup:
nodeDeviceUnlock();
virNodeDeviceObjUnlock(obj);
if (obj)
virNodeDeviceObjUnlock(obj);
VIR_FREE(wwnn);
VIR_FREE(wwpn);
return ret;