On Mon 03 May 2021 01:33:57 PM CEST, Vladimir Sementsov-Ogievskiy 
<vsement...@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