* [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
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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.