qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/6] block: fix leak of tran in bdrv_root_attach_child


From: Alberto Garcia
Subject: Re: [PATCH 1/6] block: fix leak of tran in bdrv_root_attach_child
Date: Mon, 03 May 2021 17:51:32 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Mon 03 May 2021 01:33:57 PM CEST, Vladimir Sementsov-Ogievskiy 
<vsementsov@virtuozzo.com> wrote:
> @@ -2918,12 +2918,18 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState 
> *child_bs,
>                                     child_role, perm, shared_perm, opaque,
>                                     &child, tran, errp);
>      if (ret < 0) {
> -        bdrv_unref(child_bs);
> -        return NULL;
> +        goto out;
>      }
>  
>      ret = bdrv_refresh_perms(child_bs, errp);
> +    if (ret < 0) {
> +        goto out;
> +    }
> +
> +out:

I see why you're doing this last error check, but it looks a bit
weird. My first reaction was to think that I was missing something.

I would remove it.

Berto



reply via email to

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