Thread (51 messages) 51 messages, 8 authors, 2007-02-14
STALE7046d

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

From: Jeremy Fitzhardinge <hidden>
Date: 2007-02-13 22:17:31
Also in: xen-devel

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 <redacted>
Cc: Alan <redacted>
Cc: Gerd Hoffmann <redacted>
Cc: Chris Wright <redacted>

===================================================================
--- 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);
-- 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help