diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-05-18 19:17:17 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-23 13:29:06 +0200 |
commit | ae8622ec1971cd4a63db4da25ecffa9ba21f811c (patch) | |
tree | f7eed3478d2742fe30accfd22ec0c6813567649c | |
parent | 4e24ed138b344f50a1b6ef59ad49b8a7bac15f1b (diff) | |
download | qemu-ae8622ec1971cd4a63db4da25ecffa9ba21f811c.zip qemu-ae8622ec1971cd4a63db4da25ecffa9ba21f811c.tar.gz qemu-ae8622ec1971cd4a63db4da25ecffa9ba21f811c.tar.bz2 |
sheepdog: Remove unnecessary NULL check in sd_prealloc()
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>
-rw-r--r-- | block/sheepdog.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index 4237132..2a5bc0a 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -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; |