qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 2/3] qcow2: fix the uninitialized bitmap_tabl


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH v1 2/3] qcow2: fix the uninitialized bitmap_table variable
Date: Sat, 9 Jun 2018 11:40:22 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Hi Dima,

On 06/09/2018 04:52 AM, Dima Stepanov wrote:
> The free_bitmap_clusters() routine is using the bitmap_table_load() call
> to initialize the local bitmap_table variable. bitmap_table_load()
> doesn't initialize variable to NULL in case of error. As a result a
> following assert will be hit:
>   assert(bitmap_table == NULL);
> 
> Remove this assert, since the next instruction is return from routine.

Paolo suggested a different fix, see:

https://patchwork.kernel.org/patch/9860017/

> 
> Signed-off-by: Dima Stepanov <address@hidden>
> ---
>  block/qcow2-bitmap.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
> index 60d5290..69485aa 100644
> --- a/block/qcow2-bitmap.c
> +++ b/block/qcow2-bitmap.c
> @@ -254,7 +254,6 @@ static int free_bitmap_clusters(BlockDriverState *bs, 
> Qcow2BitmapTable *tb)
>  
>      ret = bitmap_table_load(bs, tb, &bitmap_table);
>      if (ret < 0) {
> -        assert(bitmap_table == NULL);
>          return ret;
>      }
>  
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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