Message ID | 1447108773-6836-3-git-send-email-mreitz@redhat.com |
---|---|
State | New |
Headers | show |
On Mon, 11/09 23:39, Max Reitz wrote: > 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 <mreitz@redhat.com> > Reviewed-by: Alberto Garcia <berto@igalia.com> > Reviewed-by: Kevin Wolf <kwolf@redhat.com> > --- > 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) { > block_job_release(bs); > error_propagate(errp, local_err); > + bdrv_unref(bs); > return NULL; > } > } > -- > 2.6.2 > > Reviewed-by: Fam Zheng <famz@redhat.com>
Am 09.11.2015 um 23:39 hat Max Reitz geschrieben: > 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 <mreitz@redhat.com> > Reviewed-by: Alberto Garcia <berto@igalia.com> > Reviewed-by: Kevin Wolf <kwolf@redhat.com> Commit 18930ba3 already fixed this. Now adding another bdrv_unref() would be wrong, so I guess we have to simply drop the patch. NACK
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) { block_job_release(bs); error_propagate(errp, local_err); + bdrv_unref(bs); return NULL; } }