From: Paolo Bonzini <pbonzini@redhat.com>
To: Tiejun Chen <tiejun.chen@intel.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: coalesced_mmio: remove one redundant check inside of coalesced_mmio_in_range()
Date: Thu, 11 Dec 2014 12:29:01 +0100 [thread overview]
Message-ID: <54897FFD.5030806@redhat.com> (raw)
In-Reply-To: <1418266961-27277-1-git-send-email-tiejun.chen@intel.com>
On 11/12/2014 04:02, Tiejun Chen wrote:
> We already check 'len' above to make sure it already isn't
> negative here, so indeed, (addr + len < addr) should never be happened.
... except if there is an overflow.
Paolo
> Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
> ---
> virt/kvm/coalesced_mmio.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c
> index 00d8642..60f59cd 100644
> --- a/virt/kvm/coalesced_mmio.c
> +++ b/virt/kvm/coalesced_mmio.c
> @@ -30,8 +30,6 @@ static int coalesced_mmio_in_range(struct kvm_coalesced_mmio_dev *dev,
> */
> if (len < 0)
> return 0;
> - if (addr + len < addr)
> - return 0;
> if (addr < dev->zone.addr)
> return 0;
> if (addr + len > dev->zone.addr + dev->zone.size)
>
next prev parent reply other threads:[~2014-12-11 11:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-11 3:02 [PATCH] kvm: coalesced_mmio: remove one redundant check inside of coalesced_mmio_in_range() Tiejun Chen
2014-12-11 11:29 ` Paolo Bonzini [this message]
2014-12-12 1:02 ` Chen, Tiejun
2014-12-12 1:24 ` Chen, Tiejun
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=54897FFD.5030806@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=tiejun.chen@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox