From: John Ferlan Date: Wed, 28 Jun 2017 10:54:05 +0000 (-0400) Subject: nodedev: Add check for NULL obj before call Unlock X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=045b75c51540fd27eedf79673a0bd2b41dbd535e;p=libvirt.git 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. --- diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index bc5c0e50ec..5bf202e3f6 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -650,7 +650,8 @@ nodeDeviceDestroy(virNodeDevicePtr dev) cleanup: nodeDeviceUnlock(); - virNodeDeviceObjUnlock(obj); + if (obj) + virNodeDeviceObjUnlock(obj); VIR_FREE(wwnn); VIR_FREE(wwpn); return ret;