summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-10-13 11:35:33 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 18:51:39 +0200
commit716da631ae91fc5e9f8d5815f8ef5fbfed862b80 (patch)
treecfb920b117c19b4f88722e910358c2a812349a7f
parentserial: Make uart_port's ioport "unsigned long". (diff)
downloadlinux-716da631ae91fc5e9f8d5815f8ef5fbfed862b80.tar.xz
linux-716da631ae91fc5e9f8d5815f8ef5fbfed862b80.zip
nozomi: Fix close on error
Nozomi assumes the close method isn't called if open errors. The tty layer is different to other drives in this respect however. Pointed out by Denis J Barrow. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/char/nozomi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 66a0f931c66c..9a34a1935283 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -1599,7 +1599,10 @@ static int ntty_open(struct tty_struct *tty, struct file *file)
return 0;
}
-/* Called when the userspace process close the tty, /dev/noz*. */
+/* Called when the userspace process close the tty, /dev/noz*. Also
+ called immediately if ntty_open fails in which case tty->driver_data
+ will be NULL an we exit by the first return */
+
static void ntty_close(struct tty_struct *tty, struct file *file)
{
struct nozomi *dc = get_dc_by_tty(tty);