Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Cox and committed by
Linus Torvalds
716da631 0c8946d9

+4 -1
+4 -1
drivers/char/nozomi.c
··· 1599 1599 return 0; 1600 1600 } 1601 1601 1602 - /* Called when the userspace process close the tty, /dev/noz*. */ 1602 + /* Called when the userspace process close the tty, /dev/noz*. Also 1603 + called immediately if ntty_open fails in which case tty->driver_data 1604 + will be NULL an we exit by the first return */ 1605 + 1603 1606 static void ntty_close(struct tty_struct *tty, struct file *file) 1604 1607 { 1605 1608 struct nozomi *dc = get_dc_by_tty(tty);