qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for 5.0] block: fix bdrv_root_attach_child forget to unref child_bs
@ 2020-03-24 15:59 Vladimir Sementsov-Ogievskiy
  2020-03-24 16:10 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2020-03-24 15:59 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, den, vsementsov, qemu-devel, mreitz

bdrv_root_attach_child promises to drop child_bs reference on failure.
It does it on first handled failure path, but not on the second. Fix
that.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block.c b/block.c
index a2542c977b..6713db773d 100644
--- a/block.c
+++ b/block.c
@@ -2612,6 +2612,7 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs,
             error_propagate(errp, local_err);
             g_free(child);
             bdrv_abort_perm_update(child_bs);
+            bdrv_unref(child_bs);
             return NULL;
         }
     }
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for 5.0] block: fix bdrv_root_attach_child forget to unref child_bs
  2020-03-24 15:59 [PATCH for 5.0] block: fix bdrv_root_attach_child forget to unref child_bs Vladimir Sementsov-Ogievskiy
@ 2020-03-24 16:10 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2020-03-24 16:10 UTC (permalink / raw)
  To: Vladimir Sementsov-Ogievskiy; +Cc: den, qemu-devel, qemu-block, mreitz

Am 24.03.2020 um 16:59 hat Vladimir Sementsov-Ogievskiy geschrieben:
> bdrv_root_attach_child promises to drop child_bs reference on failure.
> It does it on first handled failure path, but not on the second. Fix
> that.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

Thanks, applied to the block branch.

Kevin



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-24 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 15:59 [PATCH for 5.0] block: fix bdrv_root_attach_child forget to unref child_bs Vladimir Sementsov-Ogievskiy
2020-03-24 16:10 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).