diff options
| author | Kevin Wolf | 2019-03-13 15:22:38 +0100 |
|---|---|---|
| committer | Kevin Wolf | 2019-03-19 15:49:29 +0100 |
| commit | a0cf83639c7adbdee08a5bac840c5aada019b8f3 (patch) | |
| tree | 321ea75b3cfdd92902b97d08813bb170752190c2 | |
| parent | mirror: Confirm we're quiesced only if the job is paused or cancelled (diff) | |
| download | qemu-a0cf83639c7adbdee08a5bac840c5aada019b8f3.tar.gz qemu-a0cf83639c7adbdee08a5bac840c5aada019b8f3.tar.xz qemu-a0cf83639c7adbdee08a5bac840c5aada019b8f3.zip | |
qcow2: Fix data file error condition in qcow2_co_create()
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 <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
| -rw-r--r-- | block/qcow2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 0dd77c6367..d507ee0686 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; } |
