]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
sheepdog: Remove unnecessary NULL check in sd_prealloc()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 18 May 2018 18:17:17 +0000 (19:17 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 23 May 2018 11:29:06 +0000 (13:29 +0200)
In commit 8b9ad56e9cbfd852a, we removed the code that could result
in our getting to sd_prealloc()'s out_with_err_set label with a
NULL blk pointer. That makes the NULL check in the error-handling
path unnecessary, and Coverity gripes about it (CID 1390636).
Delete the redundant check.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/sheepdog.c

index 423713241904d9cdf2c851810d4b28aa25a44513..2a5bc0a59a571fef325d2d89f9dcb1d2be318d91 100644 (file)
@@ -1859,9 +1859,7 @@ out:
         error_setg_errno(errp, -ret, "Can't pre-allocate");
     }
 out_with_err_set:
-    if (blk) {
-        blk_unref(blk);
-    }
+    blk_unref(blk);
     g_free(buf);
 
     return ret;