* [Qemu-devel] [PATCH] bochs: Fix memory leak in bochs_open() error path
@ 2014-04-09 9:20 Kevin Wolf
2014-04-09 10:27 ` Laszlo Ersek
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2014-04-09 9:20 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/bochs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/block/bochs.c b/block/bochs.c
index 826ec12..50b84a9 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -150,11 +150,13 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
s->extent_size = le32_to_cpu(bochs.extent);
if (s->extent_size == 0) {
error_setg(errp, "Extent size may not be zero");
- return -EINVAL;
+ ret = -EINVAL;
+ goto fail;
} else if (s->extent_size > 0x800000) {
error_setg(errp, "Extent size %" PRIu32 " is too large",
s->extent_size);
- return -EINVAL;
+ ret = -EINVAL;
+ goto fail;
}
if (s->catalog_size < bs->total_sectors / s->extent_size) {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] bochs: Fix memory leak in bochs_open() error path
2014-04-09 9:20 [Qemu-devel] [PATCH] bochs: Fix memory leak in bochs_open() error path Kevin Wolf
@ 2014-04-09 10:27 ` Laszlo Ersek
0 siblings, 0 replies; 2+ messages in thread
From: Laszlo Ersek @ 2014-04-09 10:27 UTC (permalink / raw)
To: Kevin Wolf, qemu-devel; +Cc: stefanha
On 04/09/14 11:20, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/bochs.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/block/bochs.c b/block/bochs.c
> index 826ec12..50b84a9 100644
> --- a/block/bochs.c
> +++ b/block/bochs.c
> @@ -150,11 +150,13 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
> s->extent_size = le32_to_cpu(bochs.extent);
> if (s->extent_size == 0) {
> error_setg(errp, "Extent size may not be zero");
> - return -EINVAL;
> + ret = -EINVAL;
> + goto fail;
> } else if (s->extent_size > 0x800000) {
> error_setg(errp, "Extent size %" PRIu32 " is too large",
> s->extent_size);
> - return -EINVAL;
> + ret = -EINVAL;
> + goto fail;
> }
>
> if (s->catalog_size < bs->total_sectors / s->extent_size) {
>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-09 10:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-09 9:20 [Qemu-devel] [PATCH] bochs: Fix memory leak in bochs_open() error path Kevin Wolf
2014-04-09 10:27 ` Laszlo Ersek
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).