[Top][All Lists]

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

[Qemu-block] [PATCH v6 02/15] blockjob: Call bdrv_unref() on creation er

From: Max Reitz
Subject: [Qemu-block] [PATCH v6 02/15] blockjob: Call bdrv_unref() on creation error
Date: Wed, 4 Nov 2015 19:57:34 +0100

If block_job_create() fails, it should release its reference to the
job's BDS. Normally, this is done in the callback provided by the
caller, but that callback will not be invoked if the block job failed to
be created.

Signed-off-by: Max Reitz <address@hidden>
 blockjob.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/blockjob.c b/blockjob.c
index c02fe59..0886a4a 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -70,6 +70,7 @@ void *block_job_create(const BlockJobDriver *driver, 
BlockDriverState *bs,
         if (local_err) {
             error_propagate(errp, local_err);
+            bdrv_unref(bs);
             return NULL;

reply via email to

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