From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwYix-0002nB-D6 for qemu-devel@nongnu.org; Wed, 11 Nov 2015 12:01:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwYgM-00034U-LZ for qemu-devel@nongnu.org; Wed, 11 Nov 2015 11:58:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwYgM-00034L-Fn for qemu-devel@nongnu.org; Wed, 11 Nov 2015 11:55:38 -0500 Date: Wed, 11 Nov 2015 18:55:33 +0200 From: "Michael S. Tsirkin" Message-ID: <20151111185527-mutt-send-email-mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v13 03/13] pcie: modify the capability size assert List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cao jin Cc: Chen Fan , alex.williamson@redhat.com, qemu-devel@nongnu.org On Wed, Nov 11, 2015 at 06:34:21PM +0800, Cao jin wrote: > From: Chen Fan > > Device's Offset and size can reach PCIE_CONFIG_SPACE_SIZE, > fix the corresponding assert. > > Signed-off-by: Chen Fan > Reviewed-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin > --- > hw/pci/pcie.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c > index 0eab29d..8f4c0e5 100644 > --- a/hw/pci/pcie.c > +++ b/hw/pci/pcie.c > @@ -607,7 +607,7 @@ void pcie_add_capability(PCIDevice *dev, > > assert(offset >= PCI_CONFIG_SPACE_SIZE); > assert(offset < offset + size); > - assert(offset + size < PCIE_CONFIG_SPACE_SIZE); > + assert(offset + size <= PCIE_CONFIG_SPACE_SIZE); > assert(size >= 8); > assert(pci_is_express(dev)); > > -- > 1.9.3