From: Alan Cox Date: Fri, 27 Jul 2012 17:02:54 +0000 (+0100) Subject: tty: Fix race in tty release X-Git-Tag: omap-cleanup-sparseirq-for-v3.7~150 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d155255a344c417acad74156654295a2964e6b81;p=pandora-kernel.git tty: Fix race in tty release Ian Abbott found that the tty layer would explode with the right set of parallel open and close operations. This is because we race in the handling of tty->drivers->termios[]. Correct this by Making tty_ldisc_release behave like nromal code (takes the lock, does stuff, drops the lock) Drop the tty lock earlier in tty_ldisc_release Taking the tty mutex around the driver->termios update in all cases Adding a WARN_ON to catch future screwups. I also forgot to clean up the pty resources properly. With a pty pair we need to pull both halves out of the tables. Signed-off-by: Alan Cox Tested-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed