From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHHRe-0003d5-G7 for qemu-devel@nongnu.org; Thu, 18 Jun 2009 09:14:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHHRa-0003YD-PM for qemu-devel@nongnu.org; Thu, 18 Jun 2009 09:14:22 -0400 Received: from [199.232.76.173] (port=56907 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHHRa-0003Xr-JS for qemu-devel@nongnu.org; Thu, 18 Jun 2009 09:14:18 -0400 Received: from oxygen.pond.sub.org ([213.239.205.148]:57310) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MHHRZ-0003Fu-Nl for qemu-devel@nongnu.org; Thu, 18 Jun 2009 09:14:18 -0400 Received: from pike.pond.sub.org (pD9E3BB74.dip.t-dialin.net [217.227.187.116]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 52E1A276D3F for ; Thu, 18 Jun 2009 15:14:16 +0200 (CEST) From: Markus Armbruster Date: Thu, 18 Jun 2009 15:14:07 +0200 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 1/4] Fix do_pci_register_device() to reject devfn already in use List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Markus Armbruster --- hw/pci.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 0a738db..36c92d7 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -251,6 +251,8 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, } return NULL; found: ; + } else if (bus->devices[devfn]) { + return NULL; } pci_dev->bus = bus; pci_dev->devfn = devfn; -- 1.6.0.6