Patchwork qxl: fix broken n_modes

login
register
mail settings
Submitter Alon Levy
Date June 14, 2012, 1:51 p.m.
Message ID <1339681903-657-1-git-send-email-alevy@redhat.com>
Download mbox | patch
Permalink /patch/164933/
State New
Headers show

Comments

Alon Levy - June 14, 2012, 1:51 p.m.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
Hi Gerd,

 Unfortunately I didn't test my previous patch "qxl: add vgamem_size_mb and vgamem_size" with the current drivers. This patch is not merged since I didn't know if it will reach before/after anothony pull. If before, then please merge it into the bad patch.

 Thanks in advance,
Alon

 hw/qxl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/hw/qxl.c b/hw/qxl.c
index 4c68769..458b9fc 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -322,7 +322,7 @@  static void init_qxl_rom(PCIQXLDevice *d)
     rom->slots_end     = NUM_MEMSLOTS - 1;
     rom->n_surfaces    = cpu_to_le32(NUM_SURFACES);
 
-    for (i = 0; i < modes->n_modes; i++) {
+    for (i = 0; i < ARRAY_SIZE(qxl_modes); i++) {
         fb = qxl_modes[i].y_res * qxl_modes[i].stride;
         if (fb <= d->vgamem_size) {
             n_modes++;