From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZDj1-0008VO-1Z for qemu-devel@nongnu.org; Tue, 21 Jun 2011 23:03:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZDiy-00031Z-U7 for qemu-devel@nongnu.org; Tue, 21 Jun 2011 23:03:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZDiy-00031L-Ga for qemu-devel@nongnu.org; Tue, 21 Jun 2011 23:03:28 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5M33QcF028047 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 Jun 2011 23:03:26 -0400 Message-ID: <4E015BCC.8090007@redhat.com> Date: Wed, 22 Jun 2011 11:04:44 +0800 From: Jason Wang MIME-Version: 1.0 References: <20110621173417.GA17272@redhat.com> In-Reply-To: <20110621173417.GA17272@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2] vhost: fix double free on device stop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: chrisw@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com 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 > --- Acked-by: Jason Wang > 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; > }