]> xenbits.xensource.com Git - libvirt.git/commitdiff
virfile: Avoid Coverity IDENTICAL_BRANCHES error
authorJohn Ferlan <jferlan@redhat.com>
Tue, 1 Sep 2015 10:56:38 +0000 (06:56 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 4 Sep 2015 19:19:04 +0000 (15:19 -0400)
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.

src/util/virfile.c

index e3c00efd9056653aad555f6b89433d6b31c3646a..408d2d912f13938bb97e20d89509a08525e006e0 100644 (file)
@@ -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;
             }
         }