On Wed, Nov 11, 2015 at 06:34:21PM +0800, Cao jin wrote: > From: Chen Fan <chen.fan.f...@cn.fujitsu.com> > > Device's Offset and size can reach PCIE_CONFIG_SPACE_SIZE, > fix the corresponding assert. > > Signed-off-by: Chen Fan <chen.fan.f...@cn.fujitsu.com> > Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>
Reviewed-by: Michael S. Tsirkin <m...@redhat.com> > --- > 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