qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [PULL 2/6] block: fix bdrv_root_attach_child forget to unref child_bs
Date: Fri, 27 Mar 2020 16:19:46 +0100	[thread overview]
Message-ID: <20200327151950.11820-3-kwolf@redhat.com> (raw)
In-Reply-To: <20200327151950.11820-1-kwolf@redhat.com>

From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

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>
---
 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



  parent reply	other threads:[~2020-03-27 15:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 15:19 [PULL 0/6] Block layer patches Kevin Wolf
2020-03-27 15:19 ` [PULL 1/6] block/iscsi:use the flags in iscsi_open() prevent Clang warning Kevin Wolf
2020-03-27 15:19 ` Kevin Wolf [this message]
2020-03-27 15:19 ` [PULL 3/6] nvme: Print 'cqid' for nvme_del_cq Kevin Wolf
2020-03-27 15:19 ` [PULL 4/6] Revert "mirror: Don't let an operation wait for itself" Kevin Wolf
2020-03-27 15:19 ` [PULL 5/6] mirror: Wait only for in-flight operations Kevin Wolf
2020-03-27 15:19 ` [PULL 6/6] qcow2: Remove unused fields from BDRVQcow2State Kevin Wolf
2020-03-27 17:38 ` [PULL 0/6] Block layer patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200327151950.11820-3-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).