qemu-block
[Top][All Lists]
Advanced

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

[Qemu-block] [PATCH] qcow2: Fix data file error condition in qcow2_co_cr


From: Kevin Wolf
Subject: [Qemu-block] [PATCH] qcow2: Fix data file error condition in qcow2_co_create()
Date: Wed, 13 Mar 2019 15:25:19 +0100

We were trying to check whether bdrv_open_blockdev_ref() returned
success, but accidentally checked the wrong variable. Spotted by
Coverity (CID 1399703).

Signed-off-by: Kevin Wolf <address@hidden>
---
 block/qcow2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index 0fc9b0561e..20aba3a4d6 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3073,7 +3073,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options, 
Error **errp)
             goto out;
         }
         data_bs = bdrv_open_blockdev_ref(qcow2_opts->data_file, errp);
-        if (bs == NULL) {
+        if (data_bs == NULL) {
             ret = -EIO;
             goto out;
         }
-- 
2.20.1




reply via email to

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