]> git.baikalelectronics.ru Git - kernel.git/commit
hvsi: don't panic on tty_register_driver failure
authorJiri Slaby <jslaby@suse.cz>
Fri, 23 Jul 2021 07:43:11 +0000 (09:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:26:30 +0000 (12:26 +0200)
commit5c056c206889660915c47f8602828c4f0560783a
tree07fbc3bd653020000760f83de6f01b5da628e59c
parentaa35d1225a44ed5a60ac87ec4f7a56ad63fc631f
hvsi: don't panic on tty_register_driver failure

[ Upstream commit 7ccbdcc4d08a6d7041e4849219bbb12ffa45db4c ]

The alloc_tty_driver failure is handled gracefully in hvsi_init. But
tty_register_driver is not. panic is called if that one fails.

So handle the failure of tty_register_driver gracefully too. This will
keep at least the console functional as it was enabled earlier by
console_initcall in hvsi_console_init. Instead of shooting down the
whole system.

This means, we disable interrupts and restore hvsi_wait back to
poll_for_state().

Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210723074317.32690-3-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/hvc/hvsi.c