qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH] virtio-scsi-dataplane: fix memory leak in virtio_scsi_vring_init
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Fam Zheng @ 2015-03-18  1:47 UTC (permalink / raw)
  To: Bo Su; +Cc: qemu-devel, qemu-stable

On Wed, 03/18 09: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);
> -- 
> 1.8.5
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-scsi-dataplane: fix memory leak in virtio_scsi_vring_init
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Gonglei @ 2015-03-18  2:16 UTC (permalink / raw)
  To: Bo Su, qemu-devel

On 2015/3/18 17: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(-)

Reviewed-by: Gonglei <arei.gonglei@huawei.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-scsi-dataplane: fix memory leak in virtio_scsi_vring_init
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2015-03-18  7:35 UTC (permalink / raw)
  To: Bo Su, qemu-devel



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH] virtio-scsi-dataplane: fix memory leak in virtio_scsi_vring_init
@ 2015-03-18  9:42 Bo Su
  2015-03-18  1:47 ` Fam Zheng
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bo Su @ 2015-03-18  9:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Bo Su

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);
-- 
1.8.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-18  7:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).