Skip to content

Commit

Permalink
nozomi: Fix close on error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Oct 13, 2008
1 parent 0c8946d commit 716da63
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/char/nozomi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 716da63

Please sign in to comment.