[PATCH] locking: remove redundant codes

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

 



From: Alex Jia <ajia@xxxxxxxxxx>

* src/locking/lock_driver_sanlock.c: remove redundant codes in error_unlink 
  label from virLockManagerSanlockSetupLockspace, in fact, the codes make 
  sure 'path' is non-null before getting to error_unlink label, so 'if (path)'
  is redundant, removing it in here and will also silence coverity.   

Signed-off-by: Alex Jia <ajia@xxxxxxxxxx>
---
 src/locking/lock_driver_sanlock.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index 2d72510..c4dce4f 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -250,8 +250,7 @@ static int virLockManagerSanlockSetupLockspace(void)
     return 0;
 
 error_unlink:
-    if (path)
-        unlink(path);
+    unlink(path);
 error:
     VIR_FORCE_CLOSE(fd);
     VIR_FREE(path);
-- 
1.7.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]