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>
This commit is contained in:
Kevin Wolf 2019-03-13 15:22:38 +01:00
parent 5e771752a1
commit a0cf83639c

View File

@ -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;
}