block: fix bdrv_root_attach_child forget to unref child_bs
PATCH 1/1 block: fix bdrv_root_attach_child forget to unref child_bs
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 <[email protected]>
--- block.c | 1 + 1 file changed, 1 insertion(+)
block.c +1 -0
@@ -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 ; } }
Signature · 1 line
2.21.0
Kevin Wolf
AppliedAm 24.03.2020 um 16:59 hat Vladimir Sementsov-Ogievskiy geschrieben:
Quoted 5 lines
bdrv_root_attach_childpromises to dropchild_bsreference on failure. It does it on first handled failure path, but not on the second. Fix that.Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>
Thanks, applied to the block branch.
Kevin