From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeMQh-0000BI-5V for qemu-devel@nongnu.org; Tue, 12 Jun 2012 04:26:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeMQc-0002VF-Gn for qemu-devel@nongnu.org; Tue, 12 Jun 2012 04:26:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeMQc-0002Uk-8f for qemu-devel@nongnu.org; Tue, 12 Jun 2012 04:26:18 -0400 Date: Tue, 12 Jun 2012 11:26:41 +0300 From: "Michael S. Tsirkin" Message-ID: <20120612082641.GC12356@redhat.com> References: <36AF4B62444F4B4FB04EDD1FDAE1CF1D4889875E@G4W3209.americas.hpqcorp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36AF4B62444F4B4FB04EDD1FDAE1CF1D4889875E@G4W3209.americas.hpqcorp.net> Subject: Re: [Qemu-devel] [PATCH] Fix for qemu crash on assertion error when adding PCI passthru device. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Ma, Stephen B." Cc: "'qemu-devel@nongnu.org'" On Tue, Jun 12, 2012 at 04:31:20AM +0000, Ma, Stephen B. wrote: > diff --git a/hw/qdev.c b/hw/qdev.c > index 6a8f6bd..d2dc28b 100644 > --- a/hw/qdev.c > +++ b/hw/qdev.c > @@ -139,7 +139,7 @@ DeviceState *qdev_try_create(BusState *bus, const char *type) > /* Initialize a device. Device properties should be set before calling > this function. IRQs and MMIO regions should be connected/mapped after > calling this function. > - On failure, destroy the device and return negative value. > + On failure, return a negative value. > Return 0 on success. */ > int qdev_init(DeviceState *dev) > { Yes, I agree. qdev_init did now allocate the device so it should not free it. > @@ -150,7 +150,6 @@ int qdev_init(DeviceState *dev) > > rc = dc->init(dev); > if (rc < 0) { > - qdev_free(dev); > return rc; > } > Another thing we need to fix is unparent the device in qdev_free. -- MST