diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-06-05 10:33:24 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-06-06 16:19:47 -0400 |
commit | f418f2ec440ab8c014f37539ef0b19271afb1186 (patch) | |
tree | 0b782de26fc7615e964a80fc75052e12b05df0fc | |
parent | d9c660e750fdf982e1e2bdd0e76c1e6c4db4217b (diff) |
vt: Don't ignore unbind errors in vt_unbind
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>
-rw-r--r-- | drivers/tty/vt/vt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 5077fe87324d..3c00dcb3b145 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
@@ -3260,6 +3260,7 @@ static int vt_unbind(struct con_driver *con) | |||
3260 | { | 3260 | { |
3261 | const struct consw *csw = NULL; | 3261 | const struct consw *csw = NULL; |
3262 | int i, more = 1, first = -1, last = -1, deflt = 0; | 3262 | int i, more = 1, first = -1, last = -1, deflt = 0; |
3263 | int ret; | ||
3263 | 3264 | ||
3264 | if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) || | 3265 | if (!con->con || !(con->flag & CON_DRIVER_FLAG_MODULE) || |
3265 | con_is_graphics(con->con, con->first, con->last)) | 3266 | con_is_graphics(con->con, con->first, con->last)) |
@@ -3285,8 +3286,10 @@ static int vt_unbind(struct con_driver *con) | |||
3285 | 3286 | ||
3286 | if (first != -1) { | 3287 | if (first != -1) { |
3287 | console_lock(); | 3288 | console_lock(); |
3288 | do_unbind_con_driver(csw, first, last, deflt); | 3289 | ret = do_unbind_con_driver(csw, first, last, deflt); |
3289 | console_unlock(); | 3290 | console_unlock(); |
3291 | if (ret != 0) | ||
3292 | return ret; | ||
3290 | } | 3293 | } |
3291 | 3294 | ||
3292 | first = -1; | 3295 | first = -1; |