tty: Make get_current_tty use a kref
authorAlan Cox <alan@redhat.com>
Mon, 13 Oct 2008 09:39:13 +0000 (10:39 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Oct 2008 16:51:41 +0000 (09:51 -0700)
commit452a00d2ee288f2cbc36f676edd06cb14d2878c1
treec8251c73924a6ac9b174bc557357bfeff0c8d1a8
parentf4d2a6c2096b764decb20070b1bf4356de9144a8
tty: Make get_current_tty use a kref

We now return a kref covered tty reference. That ensures the tty structure
doesn't go away when you have a return from get_current_tty. This is not
enough to protect you from most of the resources being freed behind your
back - yet.

[Updated to include fixes for SELinux problems found by Andrew Morton and
 an s390 leak found while debugging the former]

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/tty_io.c
drivers/s390/char/fs3270.c
fs/dquot.c
security/selinux/hooks.c