From 36839d355e4ffc77d8f937caa6bb4c5530b9237e Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 21 Aug 2012 13:51:32 +0300 Subject: [PATCH] qxl: disallow unknown revisions Signed-off-by: Alon Levy Signed-off-by: Gerd Hoffmann --- hw/qxl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.7.4