Skip to content

Commit

Permalink
vt: Don't ignore unbind errors in vt_unbind
Browse files Browse the repository at this point in the history
Otherwise the loop will never stop since we don't make any
forward progress. Noticed while breaking this accidentally
in a painful attempt to make vga_con unregistering work.

With this patch we'll bail out on the first attempt, which
at least leaves a useful enough system behind for debugging.
Livelocks on console_lock just aren't fun.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed Jun 6, 2014
1 parent d9c660e commit f418f2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/tty/vt/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3260,6 +3260,7 @@ static int vt_unbind(struct con_driver *con)
{
const struct consw *csw = NULL;
int i, more = 1, first = -1, last = -1, deflt = 0;
int ret;

if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) ||
con_is_graphics(con->con, con->first, con->last))
Expand All @@ -3285,8 +3286,10 @@ static int vt_unbind(struct con_driver *con)

if (first != -1) {
console_lock();
do_unbind_con_driver(csw, first, last, deflt);
ret = do_unbind_con_driver(csw, first, last, deflt);
console_unlock();
if (ret != 0)
return ret;
}

first = -1;
Expand Down

0 comments on commit f418f2e

Please sign in to comment.