linux-kernel-test/drivers/tty
Nobuhiro Iwamatsu 55956216f4 TTY: serial: Move mutex_unlock in uart_close function
When mutex_lock is not called, mutex_unlock is sometimes called.
This deletes unnecessary goto and makes modifications so that
mutex_unlock is called.

[    8.304000] WARNING: at kernel/muex-debug.c:78
[    8.304000] Modules linked in:
[    8.304000]
[    8.304000] Pid : 114, Comm:                 modprobe
[    8.304000] CPU : 0                  Not tainted  (3.1.0-rc3-next-20110826 #810)
[    8.304000]
[    8.304000] PC is at debug_mutex_unlock+0xf4/0x120
[    8.304000] PR is at debug_mutex_unlock+0xe6/0x120
[    8.304000] PC  : 80051114 SP  : 9f02de58 SR  : 400081f1 TEA : 295cf4f2
[    8.304000] R0  : 00000001 R1  : 00000000 R2  : 0000000f R3  : 00000000
[    8.304000] R4  : 9fc63158 R5  : 00000000 R6  : 00000001 R7  : 9fe1de78
[    8.304000] R8  : 805c6b2c R9  : 80003920 R10 : 00000000 R11 : 805c6b2c
[    8.304000] R12 : 80425ca0 R13 : 00000000 R14 : 9f02de58
[    8.304000] MACH: 00000003 MACL: 00000000 GBR : 296e1678 PR  : 80051106
[    8.304000]
[    8.304000] Call trace:
[    8.304000]  [<804236c6>] __mutex_unlock_slowpath+0x46/0x120
[    8.304000]  [<804237aa>] mutex_unlock+0xa/0x20
[    8.304000]  [<80240ed6>] uart_close+0x76/0x2c0
[    8.304000]  [<80223b98>] tty_release+0xf8/0x5c0
[    8.304000]  [<800a93a6>] lookup_object+0x26/0xa0
[    8.304000]  [<80063f6a>] call_rcu+0x8a/0xc0
[    8.304000]  [<800a944a>] put_object+0x2a/0x60
[    8.304000]  [<80003920>] arch_local_irq_restore+0x0/0x40
[    8.304000]  [<800af320>] fput+0x180/0x2c0
[    8.304000]  [<800af248>] fput+0xa8/0x2c0
[    8.304000]  [<800ab1a8>] filp_close+0x48/0xc0
[    8.304000]  [<800ab29a>] sys_close+0x7a/0x100
[    8.304000]  [<8000825a>] syscall_call+0xc/0x10
[    8.304000]  [<800ab220>] sys_close+0x0/0x100
[    8.304000]
[    8.304000] Code:
[    8.304000]   8005110e:  mov.l     @r1, r1
[    8.304000]   80051110:  tst       r1, r1
[    8.304000]   80051112:  bf        80051116
[    8.304000] ->80051114:  trapa     #62
[    8.304000]   80051116:  mov.l     @r8, r1
[    8.304000]   80051118:  tst       r1, r1
[    8.304000]   8005111a:  bt.s      8005104c
[    8.304000]   8005111c:  mov       #0, r1
[    8.304000]   8005111e:  bra       80051056
[    8.304000]
[    8.304000] ---[ end trace e8f8e04c313f429b ]---

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-22 15:47:53 -07:00
..
hvc TTY: use tty_wait_until_sent_from_close in other drivers 2011-08-25 09:00:42 -07:00
ipwireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2011-05-24 13:28:35 -07:00
serial TTY: serial: Move mutex_unlock in uart_close function 2011-09-22 15:47:53 -07:00
vt tty: clearify structure initializer in notify_write() 2011-08-23 10:48:30 -07:00
amiserial.c TTY: ami_serial, remove BTM from wait_until_sent 2011-08-23 10:34:06 -07:00
bfin_jtag_comm.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
cyclades.c TTY: mxser+cyclades remove wait_until_sent debug code 2011-08-23 10:34:07 -07:00
ehv_bytechan.c tty/powerpc: fix build break with ehv_bytechan.c on allyesconfig 2011-08-26 11:01:15 -07:00
isicom.c tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
Kconfig tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver 2011-08-23 10:32:56 -07:00
Makefile tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver 2011-08-23 10:32:56 -07:00
moxa.c drivers/tty: use printk_ratelimited() instead of printk_ratelimit() 2011-07-01 15:35:45 -07:00
moxa.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
mxser.c TTY: mxser+cyclades remove wait_until_sent debug code 2011-08-23 10:34:07 -07:00
mxser.h Fix common misspellings 2011-03-31 11:26:23 -03:00
n_gsm.c n_gsm: Send CLD command on exit 2011-08-26 11:01:14 -07:00
n_hdlc.c Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
n_r3964.c Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
n_tracerouter.c n_tracerouter and n_tracesink ldisc additions. 2011-05-13 16:31:00 -07:00
n_tracesink.c n_tracerouter and n_tracesink ldisc additions. 2011-05-13 16:31:00 -07:00
n_tracesink.h n_tracerouter and n_tracesink ldisc additions. 2011-05-13 16:31:00 -07:00
n_tty.c Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-07-25 23:09:27 -07:00
nozomi.c Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-05-26 13:19:00 -07:00
pty.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
rocket_int.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
rocket.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
rocket.h tty: move a number of tty drivers from drivers/char/ to drivers/tty/ 2011-02-22 16:14:56 -08:00
synclink_gt.c Fix common misspellings 2011-03-31 11:26:23 -03:00
synclink.c drivers/tty/synclink: remove double comment 2011-08-23 10:32:56 -07:00
synclinkmp.c Fix common misspellings 2011-03-31 11:26:23 -03:00
sysrq.c lib, arch: add filter argument to show_mem and fix private implementations 2011-03-24 17:49:37 -07:00
tty_audit.c tty_audit: fix tty_audit_add_data live lock on audit disabled 2011-03-07 12:04:50 -08:00
tty_buffer.c tty_buffer: get rid of 'seen_tail' logic in flush_to_ldisc 2011-06-08 07:46:30 -07:00
tty_io.c drivers/tty: use printk_ratelimited() instead of printk_ratelimit() 2011-07-01 15:35:45 -07:00
tty_ioctl.c Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-05-23 12:23:20 -07:00
tty_ldisc.c TTY: remove tty_locked 2011-08-23 10:34:07 -07:00
tty_mutex.c TTY: remove tty_locked 2011-08-23 10:34:07 -07:00
tty_port.c TTY: use tty_wait_until_sent_from_close in tty_port_close_start 2011-08-25 09:00:41 -07:00