From: Peter Hurley Date: Thu, 16 Oct 2014 20:54:27 +0000 (-0400) Subject: serial: core: Fix port count when uart_open() errors X-Git-Tag: omap-for-v3.19/fixes-rc1~86^2~158 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91b32f5413c17e80ac6616dd9c62e826fa438e2d;p=pandora-kernel.git serial: core: Fix port count when uart_open() errors A port count mismatch occurs if mutex_lock_interruptible() exits uart_open() and the port has already been opened. This may prematurely close a port on an open tty. Since uart_close() is _always_ called if uart_open() fails, the port count must be corrected if errors occur. Always increment the port count in uart_open(), regardless of errors; always decrement the port count in uart_close(). Note that tty_port_close_start() decrements the port count when uart_open() was successful. Signed-off-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed