Received: from [140.186.70.92] (port=35113 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQdZW-0006ms-UT for qemu-devel@nongnu.org; Mon, 21 Jun 2010 05:45:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OQdZV-0002vI-M7 for qemu-devel@nongnu.org; Mon, 21 Jun 2010 05:45:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6305) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OQdZV-0002up-DQ for qemu-devel@nongnu.org; Mon, 21 Jun 2010 05:45:41 -0400 From: Juan Quintela In-Reply-To: <99d849f1b4eeb12893447e78a6950c26a32088ac.1277100005.git.yamahata@valinux.co.jp> (Isaku Yamahata's message of "Mon, 21 Jun 2010 15:03:58 +0900") References: <99d849f1b4eeb12893447e78a6950c26a32088ac.1277100005.git.yamahata@valinux.co.jp> Date: Mon, 21 Jun 2010 11:45:15 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH v4 3/6] pci: set PCI multi-function bit appropriately. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: yu.liu@freescale.com, mst@redhat.com, qemu-devel@nongnu.org, blauwirbel@gmail.com, paul@codesourcery.com, aurelien@aurel32.net 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? Later, Juan.