From: Michael Hennerich Date: Mon, 21 May 2007 10:09:20 +0000 (+0800) Subject: Blackfin arch: Fix bug using usb keyboard crashes kernel X-Git-Tag: v2.6.22-rc3~145 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e537e9329d133526a576b741f85b3d48edc4ac1;p=pandora-kernel.git Blackfin arch: Fix bug using usb keyboard crashes kernel Without conswitchp preset, we have the following situation: - During initcalls: con_init is called, and returns because of !display_desc. - At this point there is no memory allocated for vc_cons[].d A bit later vty_init calls kbd_init. - From now on events are passed to kbd_event which will then call kbd_keycode. - kbd_keycode will oops on a NULL pointer dereference on vc->vc_tty Signed-off-by: Michael Hennerich Cc: Pekka Enberg Signed-off-by: Bryan Wu [ Added commit description based on email thread. - Linus ] Signed-off-by: Linus Torvalds --- diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 342bb8dd56ac..c456ee5c1b4a 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -175,6 +174,9 @@ void __init setup_arch(char **cmdline_p) unsigned long mtd_phys = 0; #endif +#ifdef CONFIG_DUMMY_CONSOLE + conswitchp = &dummy_con; +#endif cclk = get_cclk(); sclk = get_sclk();