Received: from [140.186.70.92] (port=58320 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQdjY-0001Wi-0x for qemu-devel@nongnu.org; Mon, 21 Jun 2010 05:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OQdjW-0004MO-NC for qemu-devel@nongnu.org; Mon, 21 Jun 2010 05:56:03 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:48484) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OQdjW-0004M7-FW for qemu-devel@nongnu.org; Mon, 21 Jun 2010 05:56:02 -0400 Date: Mon, 21 Jun 2010 18:52:16 +0900 From: Isaku Yamahata Subject: Re: [Qemu-devel] Re: [PATCH v4 3/6] pci: set PCI multi-function bit appropriately. Message-ID: <20100621095216.GB18250@valinux.co.jp> References: <99d849f1b4eeb12893447e78a6950c26a32088ac.1277100005.git.yamahata@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: yu.liu@freescale.com, mst@redhat.com, qemu-devel@nongnu.org, blauwirbel@gmail.com, paul@codesourcery.com, aurelien@aurel32.net On Mon, Jun 21, 2010 at 11:45:15AM +0200, Juan Quintela wrote: > Isaku Yamahata wrote: > > Set PCI multi-function bit according to multifunction property. > > PCI address, devfn ,is exported to users as addr property, > > so users can populate pci function(PCIDevice in qemu) > > at arbitrary devfn. > > It means each function(PCIDevice) don't know whether pci device > > (PCIDevice[8]) is multi function or not. > > So this patch allows user to set multifunction bit via property > > and checks whether multifunction bit is set correctly. > > [...] > > > @@ -629,6 +668,9 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, > > if (is_bridge) { > > pci_init_wmask_bridge(pci_dev); > > } > > + if (pci_init_multifunction(bus, pci_dev)) { > > + return NULL; > > + } > > Don't we have here a mem leak? > what frees what pci_config_alloc() assignates in the error case? Oh, you're right. Will fix it. -- yamahata