diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2020-03-24 18:59:21 +0300 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-03-27 14:47:23 +0100 |
commit | 7a26df203c7b2e4a585fc6014358b57a948fb7e0 (patch) | |
tree | fa6a2839af5ed9fc675f7ec0768f0388f233f77b | |
parent | 34afc5c298fd4b4279aeec440603b8a1a13ab8c2 (diff) |
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 <vsementsov@virtuozzo.com>
Message-Id: <20200324155921.23822-1-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | block.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -2617,6 +2617,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; } } |