Skip to content

Commit

Permalink
Blackfin arch: Fix bug using usb keyboard crashes kernel
Browse files Browse the repository at this point in the history
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 <michael.hennerich@analog.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
[ Added commit description based on email thread. - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Michael Hennerich authored and Linus Torvalds committed May 21, 2007
1 parent 8a0e665 commit 6e537e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/blackfin/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <linux/seq_file.h>
#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/console.h>
#include <linux/tty.h>

#include <linux/ext2_fs.h>
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 6e537e9

Please sign in to comment.