qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv2] vhost: fix double free on device stop


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCHv2] vhost: fix double free on device stop
Date: Wed, 22 Jun 2011 11:04:44 +0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110126 Red Hat/3.1.8-1.el6 Thunderbird/3.1.8

On 06/22/2011 01:34 AM, Michael S. Tsirkin wrote:
vhost dev stop failed to clear the log field.
Typically not an issue as dev start overwrites this field,
but if logging gets disabled before the following start,
it doesn't so this causes a double free.

Signed-off-by: Michael S. Tsirkin<address@hidden>
---
Acked-by: Jason Wang <address@hidden>
  hw/vhost.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/vhost.c b/hw/vhost.c
index 80f771e..c3d8821 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -784,5 +784,6 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice 
*vdev)

      hdev->started = false;
      qemu_free(hdev->log);
+    hdev->log = NULL;
      hdev->log_size = 0;
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]