Re: [PATCH 3/5] virfile: Avoid Coverity IDENTICAL_BRANCHES error

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

 



On 09/04/2015 10:31 AM, John Ferlan wrote:
In virFileNBDDeviceFindUnused if virFileNBDDeviceIsBusy returns 0,
then both branches jumped to cleanup, so just use ignore_value
since the function returns NULL or some memory and the caller
handles the error.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
  src/util/virfile.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index e3c00ef..408d2d9 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -797,8 +797,7 @@ virFileNBDDeviceFindUnused(void)
              if (rv < 0)
                  goto cleanup;
              if (rv == 0) {
-                if (virAsprintf(&ret, "/dev/%s", de->d_name) < 0)
-                    goto cleanup;
+                ignore_value(virAsprintf(&ret, "/dev/%s", de->d_name));
                  goto cleanup;
              }
          }

ACK.

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