aboutsummaryrefslogtreecommitdiff
path: root/hw/qxl.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-11-04 10:34:24 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-01-17 16:30:57 +0100
commit6b7332eb4013fec6ad294115ab889d77d4463624 (patch)
tree251408e92478bc19a035eea1cbe9c6706e941760 /hw/qxl.c
parent515aa3c57986b3e26558d72ecaeb7545ecd30510 (diff)
qxl: Slot sanity check in qxl_phys2virt() is off by one, fix
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/qxl.c')
-rw-r--r--hw/qxl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/qxl.c b/hw/qxl.c
index ac819271b2..bdd36f9d06 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1020,7 +1020,7 @@ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL pqxl, int group_id)
case MEMSLOT_GROUP_HOST:
return (void*)offset;
case MEMSLOT_GROUP_GUEST:
- PANIC_ON(slot > NUM_MEMSLOTS);
+ PANIC_ON(slot >= NUM_MEMSLOTS);
PANIC_ON(!qxl->guest_slots[slot].active);
PANIC_ON(offset < qxl->guest_slots[slot].delta);
offset -= qxl->guest_slots[slot].delta;