[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [patch 02/21] Xen-paravirt: Handle a zero-sized VT console



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 <jeremy@xxxxxxxxxxxxx>
Cc: Alan <alan@xxxxxxxxxxxxxxxxxxx>
Cc: Gerd Hoffmann <kraxel@xxxxxxx>
Cc: Chris Wright <chrisw@xxxxxxxxxxxx>

===================================================================
--- 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);

-- 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.