diff options
author | Paul Mackerras <paulus@samba.org> | 2012-11-14 03:15:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-14 15:27:29 -0500 |
commit | c019bc119a97aa20372c5a2cf210d209380d397d (patch) | |
tree | 176544a310cd9c97589a9aa6484d2a37558cd3f2 /drivers/tty | |
parent | 77b67063bb6bce6d475e910d3b886a606d0d91f7 (diff) |
TTY: hvc_console, fix port reference count going to zero prematurely
Commit bdb498c20040 "TTY: hvc_console, add tty install" took the port
refcounting out of hvc_open()/hvc_close(), but failed to remove the
kref_put() and tty_kref_put() calls in hvc_hangup() that were there to
remove the extra references that hvc_open() had taken.
The result was that doing a vhangup() when the current terminal was
a hvc_console, then closing the current terminal, would end up calling
destroy_hvc_struct() and making the port disappear entirely. This
meant that Fedora 17 systems would boot up but then not display the
login prompt on the console, and attempts to open /dev/hvc0 would
give a "No such device" error.
This fixes it by removing the extra kref_put() and tty_kref_put() calls.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/hvc/hvc_console.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index a5dec1ca1b82..13ee53bd0bf6 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c | |||
@@ -424,7 +424,6 @@ static void hvc_hangup(struct tty_struct *tty) | |||
424 | { | 424 | { |
425 | struct hvc_struct *hp = tty->driver_data; | 425 | struct hvc_struct *hp = tty->driver_data; |
426 | unsigned long flags; | 426 | unsigned long flags; |
427 | int temp_open_count; | ||
428 | 427 | ||
429 | if (!hp) | 428 | if (!hp) |
430 | return; | 429 | return; |
@@ -444,7 +443,6 @@ static void hvc_hangup(struct tty_struct *tty) | |||
444 | return; | 443 | return; |
445 | } | 444 | } |
446 | 445 | ||
447 | temp_open_count = hp->port.count; | ||
448 | hp->port.count = 0; | 446 | hp->port.count = 0; |
449 | spin_unlock_irqrestore(&hp->port.lock, flags); | 447 | spin_unlock_irqrestore(&hp->port.lock, flags); |
450 | tty_port_tty_set(&hp->port, NULL); | 448 | tty_port_tty_set(&hp->port, NULL); |
@@ -453,11 +451,6 @@ static void hvc_hangup(struct tty_struct *tty) | |||
453 | 451 | ||
454 | if (hp->ops->notifier_hangup) | 452 | if (hp->ops->notifier_hangup) |
455 | hp->ops->notifier_hangup(hp, hp->data); | 453 | hp->ops->notifier_hangup(hp, hp->data); |
456 | |||
457 | while(temp_open_count) { | ||
458 | --temp_open_count; | ||
459 | tty_port_put(&hp->port); | ||
460 | } | ||
461 | } | 454 | } |
462 | 455 | ||
463 | /* | 456 | /* |