From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9WPM-0003IP-0N for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:21:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9WPI-0001Gv-Aw for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:21:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9WPI-0001Fr-2C for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:21:44 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q867LhZU022120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Sep 2012 03:21:43 -0400 From: Gerd Hoffmann Date: Thu, 6 Sep 2012 09:21:35 +0200 Message-Id: <1346916100-12958-10-git-send-email-kraxel@redhat.com> In-Reply-To: <1346916100-12958-1-git-send-email-kraxel@redhat.com> References: <1346916100-12958-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 09/14] qxl: disallow unknown revisions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alon Levy , Gerd Hoffmann From: Alon Levy Signed-off-by: Alon Levy Signed-off-by: Gerd Hoffmann --- hw/qxl.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index baf9bb4..d134a70 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1798,10 +1798,13 @@ static int qxl_init_common(PCIQXLDevice *qxl) io_size = 16; break; case 3: /* qxl-3 */ - default: pci_device_rev = QXL_DEFAULT_REVISION; io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1); break; + default: + error_report("Invalid revision %d for qxl device (max %d)", + qxl->revision, QXL_DEFAULT_REVISION); + return -1; } pci_set_byte(&config[PCI_REVISION_ID], pci_device_rev); -- 1.7.1