peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0209-qxl-disallow-unknown-revisions.patch

Hans de Goede c8dfc6
From 31052a357ad124c9ed17fbc39a0db5c8d6d0d9c5 Mon Sep 17 00:00:00 2001
Hans de Goede c8dfc6
From: Alon Levy <alevy@redhat.com>
Hans de Goede c8dfc6
Date: Tue, 21 Aug 2012 13:51:32 +0300
Hans de Goede c8dfc6
Subject: [PATCH 209/215] qxl: disallow unknown revisions
Hans de Goede c8dfc6
Hans de Goede c8dfc6
Signed-off-by: Alon Levy <alevy@redhat.com>
Hans de Goede c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hans de Goede c8dfc6
---
Hans de Goede c8dfc6
 hw/qxl.c | 5 ++++-
Hans de Goede c8dfc6
 1 file changed, 4 insertions(+), 1 deletion(-)
Hans de Goede c8dfc6
Hans de Goede c8dfc6
diff --git a/hw/qxl.c b/hw/qxl.c
Hans de Goede c8dfc6
index baf9bb4..d134a70 100644
Hans de Goede c8dfc6
--- a/hw/qxl.c
Hans de Goede c8dfc6
+++ b/hw/qxl.c
Hans de Goede c8dfc6
@@ -1798,10 +1798,13 @@ static int qxl_init_common(PCIQXLDevice *qxl)
Hans de Goede c8dfc6
         io_size = 16;
Hans de Goede c8dfc6
         break;
Hans de Goede c8dfc6
     case 3: /* qxl-3 */
Hans de Goede c8dfc6
-    default:
Hans de Goede c8dfc6
         pci_device_rev = QXL_DEFAULT_REVISION;
Hans de Goede c8dfc6
         io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1);
Hans de Goede c8dfc6
         break;
Hans de Goede c8dfc6
+    default:
Hans de Goede c8dfc6
+        error_report("Invalid revision %d for qxl device (max %d)",
Hans de Goede c8dfc6
+                     qxl->revision, QXL_DEFAULT_REVISION);
Hans de Goede c8dfc6
+        return -1;
Hans de Goede c8dfc6
     }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     pci_set_byte(&config[PCI_REVISION_ID], pci_device_rev);
Hans de Goede c8dfc6
-- 
Hans de Goede c8dfc6
1.7.12
Hans de Goede c8dfc6