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: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 1/6] block: fix leak of tran in bdrv_root_attach_child
Date: Tue, 4 May 2021 09:56:29 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0

03.05.2021 18:51, Alberto Garcia wrote:
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.


Hmm. I don't know. And don't insist of course.


--
Best regards,
Vladimir



reply via email to

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