All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Cao jin <caoj.fnst@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org, marcel@redhat.com, qemu-trivial@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH] pcie: remove duplicate assertion
Date: Tue, 10 Jan 2017 00:37:51 +0200	[thread overview]
Message-ID: <20170110003733-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1482459390-14386-1-git-send-email-caoj.fnst@cn.fujitsu.com>

On Fri, Dec 23, 2016 at 10:16:30AM +0800, Cao jin wrote:
> "size >= 8" connote "size > 0"
> 
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>

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
> 
> 


WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Cao jin <caoj.fnst@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org, marcel@redhat.com, qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] pcie: remove duplicate assertion
Date: Tue, 10 Jan 2017 00:37:51 +0200	[thread overview]
Message-ID: <20170110003733-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1482459390-14386-1-git-send-email-caoj.fnst@cn.fujitsu.com>

On Fri, Dec 23, 2016 at 10:16:30AM +0800, Cao jin wrote:
> "size >= 8" connote "size > 0"
> 
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>

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	other threads:[~2017-01-09 22:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-23  2:16 [Qemu-trivial] [PATCH] pcie: remove duplicate assertion Cao jin
2016-12-23  2:16 ` [Qemu-devel] " Cao jin
2017-01-09 22:37 ` Michael S. Tsirkin [this message]
2017-01-09 22:37   ` Michael S. Tsirkin
2017-01-10  8:46   ` [Qemu-trivial] " Cao jin
2017-01-10  8:46     ` [Qemu-devel] " Cao jin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170110003733-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=marcel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.