Commit 1aeaeab3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] con_close() deadlock fix

I'd assumed that vcs_remove_devfs() could not possibly take console_sem(). 
Seems I was wrong.
parent 7d9432d8
...@@ -2487,11 +2487,13 @@ static void con_close(struct tty_struct *tty, struct file *filp) ...@@ -2487,11 +2487,13 @@ static void con_close(struct tty_struct *tty, struct file *filp)
if (tty && tty->count == 1) { if (tty && tty->count == 1) {
struct vt_struct *vt; struct vt_struct *vt;
vcs_remove_devfs(tty);
vt = tty->driver_data; vt = tty->driver_data;
if (vt) if (vt)
vc_cons[vt->vc_num].d->vc_tty = NULL; vc_cons[vt->vc_num].d->vc_tty = NULL;
tty->driver_data = 0; tty->driver_data = 0;
release_console_sem();
vcs_remove_devfs(tty);
return;
} }
release_console_sem(); release_console_sem();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment