From: Ján Tomko Date: Sun, 2 Aug 2020 20:52:51 +0000 (+0200) Subject: vz: remove redundant NULL pointer check X-Git-Tag: v6.7.0-rc1~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb5a4844ba4135c27bc25e9655c12f720b232dfc;p=thirdparty%2Flibvirt.git vz: remove redundant NULL pointer check The 'dom' pointer is already dereferenced earlier. src/vz/vz_sdk.c:249:24: warning: Either the condition 'if(dom)' is redundant or there is possible null pointer dereference: dom. [nullPointerRedundantCheck] Signed-off-by: Ján Tomko Reviewed-by: Martin Kletzander --- diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index b5e69b385f..bb1ef0ea47 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -256,11 +256,11 @@ waitDomainJobHelper(PRL_HANDLE job, virDomainObjPtr dom, unsigned int timeout, } pdom->job.sdkJob = job; - if (dom) - virObjectUnlock(dom); + + virObjectUnlock(dom); ret = waitJobHelper(job, timeout, filename, funcname, linenr); - if (dom) - virObjectLock(dom); + virObjectLock(dom); + pdom->job.sdkJob = NULL; return ret;