f375e62
From 0826dcf575c1f88b5082458d3876c2bfe0a1d9a3 Mon Sep 17 00:00:00 2001
c8dfc65
From: Alon Levy <alevy@redhat.com>
c8dfc65
Date: Tue, 21 Aug 2012 13:51:32 +0300
5544c1b
Subject: [PATCH] qxl: disallow unknown revisions
c8dfc65
c8dfc65
Signed-off-by: Alon Levy <alevy@redhat.com>
c8dfc65
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
c8dfc65
---
5544c1b
 hw/qxl.c | 6 +++---
5544c1b
 1 file changed, 3 insertions(+), 3 deletions(-)
c8dfc65
c8dfc65
diff --git a/hw/qxl.c b/hw/qxl.c
f375e62
index e7e9dd9..20e844f 100644
c8dfc65
--- a/hw/qxl.c
c8dfc65
+++ b/hw/qxl.c
5544c1b
@@ -1873,9 +1873,9 @@ static int qxl_init_common(PCIQXLDevice *qxl)
c8dfc65
         break;
5544c1b
 #endif
5544c1b
     default:
5544c1b
-        pci_device_rev = QXL_DEFAULT_REVISION;
5544c1b
-        io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1);
5544c1b
-        break;
c8dfc65
+        error_report("Invalid revision %d for qxl device (max %d)",
c8dfc65
+                     qxl->revision, QXL_DEFAULT_REVISION);
c8dfc65
+        return -1;
c8dfc65
     }
c8dfc65
 
c8dfc65
     pci_set_byte(&config[PCI_REVISION_ID], pci_device_rev);