X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fvga.c;h=f9c4e9022600a8c0f1c1ee74fda84e2cf1ecd574;hb=c2218fcbc6023d380dbf88895fed679a8e14a210;hp=a507f48043322e108009ac3182d1408acb77edd1;hpb=68b024c05395634f2c024b0a69c6f4868b4b518a;p=palacios.git diff --git a/palacios/src/devices/vga.c b/palacios/src/devices/vga.c index a507f48..f9c4e90 100644 --- a/palacios/src/devices/vga.c +++ b/palacios/src/devices/vga.c @@ -2845,12 +2845,17 @@ static int vga_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { // Now allocate the maps for (i=0;imap[i] = (vga_map) V3_VAddr((void*)V3_AllocPages(MAP_SIZE/4096)); - if (!(vga->map[i])) { + void *temp; + + temp = (void*)V3_AllocPages(MAP_SIZE/4096); + if (!temp) { PrintError("vga: cannot allocate maps\n"); free_vga(vga); return -1; } + + vga->map[i] = (vga_map) V3_VAddr(temp); + memset(vga->map[i],0,MAP_SIZE); }