Date: Fri, 10 Apr 1998 09:53:08 +0200 (CEST)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: Linux/m68k <linux-m68k@lists.linux-m68k.org>
Subject: L68K: Fix for console.new.c
Sender: owner-linux-m68k@phil.uni-sb.de


Fix NULL pointer bug: if you boot with a serial console and want to 
change the screen resolution in your rc.local using fbset, there's no tty
associated with the foreground console yet.

--- drivers/char/console.new.c	1998/02/18 19:32:12	1.1.2.3
+++ drivers/char/console.new.c	1998/04/09 20:57:04
@@ -433,7 +433,6 @@
 	unsigned long occ, oll, oss, osr;
 	unsigned short *newscreen;
 	long ol, nl, rlth, rrem;
-	struct winsize ws, *cws;
 
 	if (!cols || !lines || currcons >= MAX_NR_CONSOLES)
 	    return;
@@ -496,13 +495,15 @@
 	    gotoxy(currcons, x, y);
 	    save_cur(currcons);
 
-	    cws = &console_table[currcons]->winsize;
-	    ws.ws_row = video_num_lines;
-	    ws.ws_col = video_num_columns;
-	    if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) &&
-		console_table[currcons]->pgrp > 0)
-		kill_pg(console_table[currcons]->pgrp, SIGWINCH, 1);
-	    *cws = ws;
+	    if (console_table[currcons]) {
+		struct winsize ws, *cws = &console_table[currcons]->winsize;
+		ws.ws_row = video_num_lines;
+		ws.ws_col = video_num_columns;
+		if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) &&
+		    console_table[currcons]->pgrp > 0)
+		    kill_pg(console_table[currcons]->pgrp, SIGWINCH, 1);
+		*cws = ws;
+	    }
 	}
 
 	/* don't update in graphics mode */

Greetings,

						Geert

--
Geert Uytterhoeven                     Geert.Uytterhoeven@cs.kuleuven.ac.be
Wavelets, Linux/{m68k~Amiga,PPC~CHRP}  http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

