From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken CC Subject: Re: [PATCH 2/3] pci init: fail qemu if devfn exceeding the max devices number supported on bus Date: Tue, 24 Aug 2010 14:51:33 +0800 Message-ID: <20100824065132.GC11495@kt> References: <20100824062517.12408.45246.stgit@k1> <20100824063351.GB10815@kt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: yamahata@valinux.co.jp, qemu-devel@nongnu.org To: kvm@vger.kernel.org Return-path: Received: from mail-qy0-f174.google.com ([209.85.216.174]:48045 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805Ab0HXGvh (ORCPT ); Tue, 24 Aug 2010 02:51:37 -0400 Received: by qyk9 with SMTP id 9so3417766qyk.19 for ; Mon, 23 Aug 2010 23:51:36 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20100824063351.GB10815@kt> Sender: kvm-owner@vger.kernel.org List-ID: broken thread, please ignore. On Tue, Aug 24, 2010 at 02:33:51PM +0800, Ken CC wrote: > assert(devfn < PCIBUS_MAX_DEVICES) > > Signed-off-by: Ken CC > --- > hw/pci.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index 02019a1..1e804da 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -747,6 +747,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, > PCIConfigWriteFunc *config_write, > bool is_bridge) > { > + assert(devfn < PCIBUS_MAX_DEVICES); > if (devfn < 0) { > for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices); > devfn += PCI_FUNC_MAX) { > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45680 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnnMp-0003xg-Gz for qemu-devel@nongnu.org; Tue, 24 Aug 2010 02:52:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnnM9-00059V-7B for qemu-devel@nongnu.org; Tue, 24 Aug 2010 02:51:38 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:56178) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnnM9-00059L-3H for qemu-devel@nongnu.org; Tue, 24 Aug 2010 02:51:37 -0400 Received: by qyk5 with SMTP id 5so3580396qyk.4 for ; Mon, 23 Aug 2010 23:51:36 -0700 (PDT) Date: Tue, 24 Aug 2010 14:51:33 +0800 From: Ken CC Message-ID: <20100824065132.GC11495@kt> References: <20100824062517.12408.45246.stgit@k1> <20100824063351.GB10815@kt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100824063351.GB10815@kt> Subject: [Qemu-devel] Re: [PATCH 2/3] pci init: fail qemu if devfn exceeding the max devices number supported on bus List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org Cc: yamahata@valinux.co.jp, qemu-devel@nongnu.org broken thread, please ignore. On Tue, Aug 24, 2010 at 02:33:51PM +0800, Ken CC wrote: > assert(devfn < PCIBUS_MAX_DEVICES) > > Signed-off-by: Ken CC > --- > hw/pci.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index 02019a1..1e804da 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -747,6 +747,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, > PCIConfigWriteFunc *config_write, > bool is_bridge) > { > + assert(devfn < PCIBUS_MAX_DEVICES); > if (devfn < 0) { > for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices); > devfn += PCI_FUNC_MAX) { > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --