[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qcow2: Fix data file error condition in qcow2_c
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] qcow2: Fix data file error condition in qcow2_co_create() |
Date: |
Wed, 13 Mar 2019 09:32:05 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 |
On 3/13/19 9:25 AM, Kevin Wolf wrote:
> 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(-)
Reviewed-by: Eric Blake <address@hidden>
>
> 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;
> }
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature