aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-03-04 14:55:19 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-17 14:07:10 +0900
commit5362544bebe85071188dd9e479b5a5040841c895 (patch)
treebf7a38ccddbeeb382f2f856a659fef8faf7814f6 /arch
parentRevert "tty: serial: pl011: add ttyAMA for matching pl011 console" (diff)
downloadlinux-dev-5362544bebe85071188dd9e479b5a5040841c895.tar.xz
linux-dev-5362544bebe85071188dd9e479b5a5040841c895.zip
tty: don't panic on OOM in tty_set_ldisc()
If tty_ldisc_open() fails in tty_set_ldisc(), it tries to go back to the old discipline or N_TTY. But that can fail as well, in such case it panics. This is not a graceful way to handle OOM. Leave ldisc==NULL if all attempts fail instead. Also use existing tty_ldisc_reinit() helper function instead of tty_ldisc_restore(). Also don't WARN/BUG in tty_ldisc_reinit() if N_TTY fails, which would have the same net effect of bringing kernel down on OOM. Instead print a single line message about what has happened. Signed-off-by: Dmitry Vyukov <dvyukov@google.com> Cc: syzkaller@googlegroups.com Cc: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: Peter Hurley <peter@hurleysoftware.com> Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions