From: Max Reitz <mreitz@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
stefanha@redhat.com, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] virtio-scsi: Fix memory leak when realize failed
Date: Mon, 03 Nov 2014 09:53:07 +0100 [thread overview]
Message-ID: <54574273.8090606@redhat.com> (raw)
In-Reply-To: <1414669826-21550-1-git-send-email-famz@redhat.com>
On 2014-10-30 at 12:50, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
> hw/scsi/virtio-scsi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
> index a1725b8..4aae1e8 100644
> --- a/hw/scsi/virtio-scsi.c
> +++ b/hw/scsi/virtio-scsi.c
> @@ -793,6 +793,7 @@ void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
> error_setg(errp, "Invalid number of queues (= %" PRId32 "), "
> "must be a positive integer less than %d.",
> s->conf.num_queues, VIRTIO_PCI_QUEUE_MAX);
> + virtio_cleanup(vdev);
> return;
> }
> s->cmd_vqs = g_malloc0(s->conf.num_queues * sizeof(VirtQueue *));
The alternative would be to simply push virtio_init() below this check,
but it's fine either way.
Reviewed-by: Max Reitz <mreitz@redhat.com>
next prev parent reply other threads:[~2014-11-03 8:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 11:50 [Qemu-devel] [PATCH] virtio-scsi: Fix memory leak when realize failed Fam Zheng
2014-11-03 8:53 ` Max Reitz [this message]
2014-11-03 9:17 ` Fam Zheng
2014-11-03 9:17 ` Max Reitz
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=54574273.8090606@redhat.com \
--to=mreitz@redhat.com \
--cc=famz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).