qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH for 5.0] block: fix bdrv_root_attach_child forget to unref child_


From: Vladimir Sementsov-Ogievskiy
Subject: [PATCH for 5.0] block: fix bdrv_root_attach_child forget to unref child_bs
Date: Tue, 24 Mar 2020 18:59:21 +0300

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 <address@hidden>
---
 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




reply via email to

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