qemu-block
[Top][All Lists]
Advanced

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

[PULL 2/6] block: fix bdrv_root_attach_child forget to unref child_bs


From: Kevin Wolf
Subject: [PULL 2/6] block: fix bdrv_root_attach_child forget to unref child_bs
Date: Fri, 27 Mar 2020 16:19:46 +0100

From: Vladimir Sementsov-Ogievskiy <address@hidden>

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>
Message-Id: <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 block.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block.c b/block.c
index af3faf664e..2e3905c99e 100644
--- a/block.c
+++ b/block.c
@@ -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;
         }
     }
-- 
2.20.1




reply via email to

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