If we're running under Xen, then there's no VT console.  This results
in vc->vc_screenbuf_size == 0, which causes alloc_bootmem to panic.
Don't bother allocating a vc_screenbuf if its going to be 0 sized.

(Cleanup: remove unnecessary cast)

Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]>
Cc: Alan <[EMAIL PROTECTED]>
Cc: Gerd Hoffmann <[EMAIL PROTECTED]>
Cc: Chris Wright <[EMAIL PROTECTED]>

===================================================================
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2638,7 +2638,10 @@ static int __init con_init(void)
        for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) {
                vc_cons[currcons].d = vc = alloc_bootmem(sizeof(struct 
vc_data));
                visual_init(vc, currcons, 1);
-               vc->vc_screenbuf = (unsigned short 
*)alloc_bootmem(vc->vc_screenbuf_size);
+
+               vc->vc_screenbuf = NULL;
+               if (vc->vc_screenbuf_size)
+                       vc->vc_screenbuf = alloc_bootmem(vc->vc_screenbuf_size);
                vc->vc_kmalloced = 0;
                vc_init(vc, vc->vc_rows, vc->vc_cols,
                        currcons || !vc->vc_sw->con_save_screen);

-- 

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/virtualization

Reply via email to