Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282004
b: refs/heads/master
c: 1a21424
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and Avi Kivity committed Dec 27, 2011
1 parent 1bef8eb commit 4624cff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f2e5260f5a17d37be3e3c83aca2f335b9bf3893
refs/heads/master: 1a214246cbb431f7430f7d0c0fb66218a6f442d2
12 changes: 9 additions & 3 deletions trunk/virt/kvm/coalesced_mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ static int coalesced_mmio_in_range(struct kvm_coalesced_mmio_dev *dev,
* (addr,len) is fully included in
* (zone->addr, zone->size)
*/

return (dev->zone.addr <= addr &&
addr + len <= dev->zone.addr + dev->zone.size);
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)
return 0;
return 1;
}

static int coalesced_mmio_has_room(struct kvm_coalesced_mmio_dev *dev)
Expand Down

0 comments on commit 4624cff

Please sign in to comment.