From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn7fg-0002AW-Oi for qemu-devel@nongnu.org; Tue, 17 Jan 2012 06:57:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rn7ff-0001BA-LX for qemu-devel@nongnu.org; Tue, 17 Jan 2012 06:57:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn7ff-0001B3-4n for qemu-devel@nongnu.org; Tue, 17 Jan 2012 06:57:47 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0HBvjXx004639 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 17 Jan 2012 06:57:45 -0500 Date: Tue, 17 Jan 2012 13:57:41 +0200 From: Alon Levy Message-ID: <20120117115704.GH5773@garlic> References: <1320399264-28581-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] qxl: Slot sanity check in qxl_phys2virt() is off by one, fix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, kraxel@redhat.com On Tue, Jan 17, 2012 at 10:08:47AM +0100, Markus Armbruster wrote: > Ping? > > Markus Armbruster writes: > Reviewed-by: Alon Levy > > Spotted by Coverity. > > > > Signed-off-by: Markus Armbruster > > --- > > hw/qxl.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/hw/qxl.c b/hw/qxl.c > > index 84ffd45..c97bebe 100644 > > --- a/hw/qxl.c > > +++ b/hw/qxl.c > > @@ -1006,7 +1006,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; >