From patchwork Thu Mar 15 16:29:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 147044 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C3E76B6F9F for ; Fri, 16 Mar 2012 03:30:38 +1100 (EST) Received: from localhost ([::1]:58578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8DZT-0000Ys-JL for incoming@patchwork.ozlabs.org; Thu, 15 Mar 2012 12:30:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8DZ4-0000U6-36 for qemu-devel@nongnu.org; Thu, 15 Mar 2012 12:30:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8DZ2-0004zU-A4 for qemu-devel@nongnu.org; Thu, 15 Mar 2012 12:30:09 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:48443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8DZ2-0004sF-5m for qemu-devel@nongnu.org; Thu, 15 Mar 2012 12:30:08 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2012 12:29:59 -0400 Received: from d01dlp01.pok.ibm.com (9.56.224.56) by e7.ny.us.ibm.com (192.168.1.107) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2012 12:29:58 -0400 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 0A2E938C807E for ; Thu, 15 Mar 2012 12:29:58 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q2FGTvlB268298 for ; Thu, 15 Mar 2012 12:29:57 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q2FM0oYg012540 for ; Thu, 15 Mar 2012 18:00:50 -0400 Received: from titi.austin.rr.com (sig-9-65-116-158.mts.ibm.com [9.65.116.158]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q2FM0nVY012468; Thu, 15 Mar 2012 18:00:49 -0400 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Thu, 15 Mar 2012 11:29:56 -0500 Message-Id: <1331828996-17164-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.5.4 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12031516-5806-0000-0000-00001377947E X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 32.97.182.137 Cc: Anthony Liguori , Michael Tsirkin Subject: [Qemu-devel] [PATCH] pci: fix double free of romfile property X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The qdev property release function frees any string properties. This was resulting in a double free during hot unplug. It manifests in network devices because block devices have a NULL romfile property by default. Cc: Michael Tsirkin Signed-off-by: Anthony Liguori --- hw/pci.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index bf046bf..ed8ec99 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -841,7 +841,6 @@ static int pci_unregister_device(DeviceState *dev) pci_unregister_io_regions(pci_dev); pci_del_option_rom(pci_dev); - g_free(pci_dev->romfile); do_pci_unregister_device(pci_dev); return 0; }