[libvirt PATCH 1/8] vz: remove redundant NULL pointer check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jtomko@xxxxxxxxxx>
---
 src/vz/vz_sdk.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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;
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux