]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
nozomi: Fix close on error
authorAlan Cox <alan@redhat.com>
Mon, 13 Oct 2008 09:35:33 +0000 (10:35 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Oct 2008 16:51:39 +0000 (09:51 -0700)
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>
drivers/char/nozomi.c

index 66a0f931c66ca91bf06b56e0b789edb8a0d68204..9a34a1935283370a837bd0c72fa5d05463ff2ae7 100644 (file)
@@ -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);