[Top][All Lists]

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

[Qemu-devel] [PULL 04/46] sheepdog: Remove unnecessary NULL check in sd_

From: Kevin Wolf
Subject: [Qemu-devel] [PULL 04/46] sheepdog: Remove unnecessary NULL check in sd_prealloc()
Date: Wed, 23 May 2018 15:11:13 +0200

From: Peter Maydell <address@hidden>

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 <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
 block/sheepdog.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index 4237132419..2a5bc0a59a 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1859,9 +1859,7 @@ out:
         error_setg_errno(errp, -ret, "Can't pre-allocate");
-    if (blk) {
-        blk_unref(blk);
-    }
+    blk_unref(blk);
     return ret;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]