[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
- [PATCH 0/6] block permission updated follow-up, Vladimir Sementsov-Ogievskiy, 2021/05/03
- [PATCH 1/6] block: fix leak of tran in bdrv_root_attach_child, Vladimir Sementsov-Ogievskiy, 2021/05/03
- Re: [PATCH 1/6] block: fix leak of tran in bdrv_root_attach_child,
Alberto Garcia <=
- [PATCH 2/6] block: bdrv_reopen_multiple(): fix leak of tran object, Vladimir Sementsov-Ogievskiy, 2021/05/03
- [PATCH 6/6] block: improve permission conflict error message, Vladimir Sementsov-Ogievskiy, 2021/05/03
- [PATCH 3/6] block-backend: improve blk_root_get_parent_desc(), Vladimir Sementsov-Ogievskiy, 2021/05/03
- [PATCH 4/6] block: improve bdrv_child_get_parent_desc(), Vladimir Sementsov-Ogievskiy, 2021/05/03
- [PATCH 5/6] block: simplify bdrv_child_user_desc(), Vladimir Sementsov-Ogievskiy, 2021/05/03