From: Paolo Bonzini <pbonzini@redhat.com>
To: Bo Su <subo7@huawei.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] virtio-scsi-dataplane: fix memory leak in virtio_scsi_vring_init
Date: Wed, 18 Mar 2015 08:35:05 +0100 [thread overview]
Message-ID: <55092AA9.8030303@redhat.com> (raw)
In-Reply-To: <1426671732-80213-1-git-send-email-subo7@huawei.com>
On 18/03/2015 10:42, Bo Su wrote:
> if k->set_host_notifier failed, VirtIOSCSIVring *r will leak
>
> Signed-off-by: Bo Su <subo7@huawei.com>
> ---
> hw/scsi/virtio-scsi-dataplane.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c
> index 3f40ff0..c069cd7 100644
> --- a/hw/scsi/virtio-scsi-dataplane.c
> +++ b/hw/scsi/virtio-scsi-dataplane.c
> @@ -45,7 +45,7 @@ static VirtIOSCSIVring *virtio_scsi_vring_init(VirtIOSCSI *s,
> {
> BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(s)));
> VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
> - VirtIOSCSIVring *r = g_slice_new(VirtIOSCSIVring);
> + VirtIOSCSIVring *r;
> int rc;
>
> /* Set up virtqueue notify */
> @@ -56,6 +56,8 @@ static VirtIOSCSIVring *virtio_scsi_vring_init(VirtIOSCSI *s,
> s->dataplane_fenced = true;
> return NULL;
> }
> +
> + r = g_slice_new(VirtIOSCSIVring);
> r->host_notifier = *virtio_queue_get_host_notifier(vq);
> r->guest_notifier = *virtio_queue_get_guest_notifier(vq);
> aio_set_event_notifier(s->ctx, &r->host_notifier, handler);
>
Thanks, queued for 2.3.
Paolo
prev parent reply other threads:[~2015-03-18 7:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 9:42 [Qemu-devel] [PATCH] virtio-scsi-dataplane: fix memory leak in virtio_scsi_vring_init Bo Su
2015-03-18 1:47 ` Fam Zheng
2015-03-18 2:16 ` Gonglei
2015-03-18 7:35 ` Paolo Bonzini [this message]
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=55092AA9.8030303@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=subo7@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.