Message ID | 1401315594-12662-2-git-send-email-mreitz@redhat.com |
---|---|
State | New |
Headers | show |
On 05/28/2014 04:19 PM, Max Reitz wrote: > If bs->drv is NULL, iov.iov_base should not be leaked. > > Signed-off-by: Max Reitz <mreitz@redhat.com> > --- > block/qcow2-cluster.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake <eblake@redhat.com> > > diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c > index 33e6826..d391c5a 100644 > --- a/block/qcow2-cluster.c > +++ b/block/qcow2-cluster.c > @@ -387,7 +387,8 @@ static int coroutine_fn copy_sectors(BlockDriverState *bs, > BLKDBG_EVENT(bs->file, BLKDBG_COW_READ); > > if (!bs->drv) { > - return -ENOMEDIUM; > + ret = -ENOMEDIUM; > + goto out; > } > > /* Call .bdrv_co_readv() directly instead of using the public block-layer >
Am 29.05.2014 um 00:19 hat Max Reitz geschrieben: > If bs->drv is NULL, iov.iov_base should not be leaked. > > Signed-off-by: Max Reitz <mreitz@redhat.com> Funny how such things go unnoticed for months and then three people fix it independently in the same week. Anyway, I won: commit bd604369 ;-) Kevin
On 30.05.2014 13:40, Kevin Wolf wrote: > Am 29.05.2014 um 00:19 hat Max Reitz geschrieben: >> If bs->drv is NULL, iov.iov_base should not be leaked. >> >> Signed-off-by: Max Reitz <mreitz@redhat.com> > Funny how such things go unnoticed for months and then three people fix > it independently in the same week. Anyway, I won: commit bd604369 ;-) Well, I noticed it while reviewing your series, so it may be not too coincidental. ;-) Max
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 33e6826..d391c5a 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -387,7 +387,8 @@ static int coroutine_fn copy_sectors(BlockDriverState *bs, BLKDBG_EVENT(bs->file, BLKDBG_COW_READ); if (!bs->drv) { - return -ENOMEDIUM; + ret = -ENOMEDIUM; + goto out; } /* Call .bdrv_co_readv() directly instead of using the public block-layer
If bs->drv is NULL, iov.iov_base should not be leaked. Signed-off-by: Max Reitz <mreitz@redhat.com> --- block/qcow2-cluster.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)