qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH] pcie: remove duplicate assertion


From: Michael S. Tsirkin
Subject: Re: [Qemu-trivial] [PATCH] pcie: remove duplicate assertion
Date: Tue, 10 Jan 2017 00:37:51 +0200

On Fri, Dec 23, 2016 at 10:16:30AM +0800, Cao jin wrote:
> "size >= 8" connote "size > 0"
> 
> Signed-off-by: Cao jin <address@hidden>

Isn't the point to check for overflows?

> ---
>  hw/pci/pcie.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> index 39b10b852d91..f864c5cd5458 100644
> --- a/hw/pci/pcie.c
> +++ b/hw/pci/pcie.c
> @@ -668,7 +668,6 @@ void pcie_add_capability(PCIDevice *dev,
>      uint16_t next;
>  
>      assert(offset >= PCI_CONFIG_SPACE_SIZE);
> -    assert(offset < offset + size);
>      assert(offset + size <= PCIE_CONFIG_SPACE_SIZE);
>      assert(size >= 8);
>      assert(pci_is_express(dev));
> -- 
> 2.1.0
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]