s390/sclp_vt220: Fix kernel panic due to early terminal input
authorPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Wed, 9 Apr 2014 11:10:05 +0000 (13:10 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 11 Apr 2014 11:53:38 +0000 (13:53 +0200)
commite106e4ea44699cc940a919924f2834b91f426d9f
tree3eb2b8230a0ef43de5965dc5381d58db1bd4b41c
parent572c3eb7f841c019f756efc68debbc3187c2a62c
s390/sclp_vt220: Fix kernel panic due to early terminal input

A kernel panic might occur when there is terminal input available via
the SCLP VT220 interface at an early time during the boot process.

The processing of terminal input requires prior initialization which is
done via an early_initcall function (init_workqueues) while the SCLP
VT220 driver registers for terminal input during a console_initcall
function (sclp_vt220_con_init). When there is terminal input available
via the SCLP interface between console_initcall and early_initcall, a
null pointer dereference occurs (system_wq is null).

Fix this problem by moving the registration for terminal input to a
device_initcall function (sclp_vt220_tty_init).

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/sclp_vt220.c