linux/drivers/tty/serial
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
..
cpm_uart tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
jsm jsm: print byte we are dequeing 2011-08-24 15:29:44 -07:00
8250.c tty: 8250: export serial8250_handle_irq 2011-08-26 11:38:45 -07:00
8250.h tty/serial: Add explicit PORT_TEGRA type 2011-05-19 16:51:01 -07:00
8250_accent.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_acorn.c
8250_boca.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_dw.c tty: add a DesignWare 8250 driver 2011-08-26 11:38:46 -07:00
8250_early.c
8250_exar_st16c554.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_fourport.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_gsc.c
8250_hp300.c
8250_hub6.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_mca.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_pci.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
8250_pnp.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
21285.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
68328serial.c arch, mm: filter disallowed nodes from arch specific show_mem functions 2011-05-25 08:39:03 -07:00
68328serial.h
68360serial.c Merge 2.6.38-rc6 into tty-next 2011-02-24 11:36:31 -08:00
altera_jtaguart.c Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6 2011-03-16 17:28:10 -07:00
altera_uart.c serial: altera_uart: Scan for a free port if platform device id is -1 2011-04-19 16:31:19 -07:00
amba-pl010.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
amba-pl011.c amba pl011: workaround for uart registers lockup 2011-07-08 15:09:23 -07:00
apbuart.c sparc32,leon: Fixed APBUART frequency detection 2011-03-30 04:28:54 -07:00
apbuart.h
atmel_serial.c atmel_serial: RS485: receiving enabled when sending data 2011-08-24 15:27:59 -07:00
bcm63xx_uart.c serial: bcm63xx_uart: fix irq storm after rx fifo overrun. 2011-06-16 12:01:58 -07:00
bfin_sport_uart.c treewide: cleanup continuations and remove logging message whitespace 2011-04-26 10:24:37 +02:00
bfin_sport_uart.h
bfin_uart.c serial:bfin_uart: Put TX IRQ in individual platform resource. 2011-08-23 10:48:31 -07:00
clps711x.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
crisv10.c tty: now phase out the ioctl file pointer for good 2011-02-17 11:59:56 -08:00
crisv10.h
dz.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
dz.h
icom.c Fix common misspellings 2011-03-31 11:26:23 -03:00
icom.h
ifx6x60.c net: remove mm.h inclusion from netdevice.h 2011-06-21 19:17:20 -07:00
ifx6x60.h serial: ifx6x60: minor cleanup 2011-02-17 11:16:15 -08:00
imx.c serial/imx: support to handle break character 2011-08-24 15:27:59 -07:00
ioc3_serial.c
ioc4_serial.c
ip22zilog.c Fix common misspellings 2011-03-31 11:26:23 -03:00
ip22zilog.h
Kconfig tty: add a DesignWare 8250 driver 2011-08-26 11:38:46 -07:00
kgdboc.c kgdboc,kgdbts: strlen() doesn't count the terminator 2011-03-25 16:37:30 -05:00
lantiq.c SERIAL: Lantiq: Add driver for MIPS Lantiq SOCs. 2011-05-19 09:55:43 +01:00
m32r_sio.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
m32r_sio.h
m32r_sio_reg.h
Makefile tty: add a DesignWare 8250 driver 2011-08-26 11:38:46 -07:00
max3100.c workqueue, freezer: unify spelling of 'freeze' + 'able' to 'freezable' 2011-02-16 17:48:59 +01:00
max3107-aava.c
max3107.c workqueue, freezer: unify spelling of 'freeze' + 'able' to 'freezable' 2011-02-16 17:48:59 +01:00
max3107.h Fix common misspellings 2011-03-31 11:26:23 -03:00
mcf.c
mfd.c hsu: add runtime pm support 2011-08-26 11:01:13 -07:00
mpc52xx_uart.c dt/serial: Eliminate users of of_platform_{,un}register_driver 2011-02-28 13:22:46 -07:00
mpsc.c
mrst_max3110.c max3110: Fix up port->tty backreferencing 2011-08-26 11:01:15 -07:00
mrst_max3110.h max3110: add sysrq support 2011-08-26 11:01:15 -07:00
msm_serial.c TTY: msm_serial, remove unneeded console set 2011-08-23 10:34:05 -07:00
msm_serial.h tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
msm_serial_hs.c Fix common misspellings 2011-03-31 11:26:23 -03:00
msm_smd_tty.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
mux.c
mxs-auart.c Freescale STMP37XX/STMP378X Application UART driver: remove duplicate linux/device.h include 2011-02-15 18:35:42 +01:00
netx-serial.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
nwpserial.c
of_serial.c Revert "tty: of_serial: add support for the DesignWare 8250" 2011-08-24 15:24:54 -07:00
omap-serial.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
pch_uart.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
pmac_zilog.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
pmac_zilog.h
pnx8xxx_uart.c
pxa.c serial: pxa: work around for errata #20 2011-09-22 15:47:53 -07:00
s3c2410.c serial: Remove redundant console_initcall from s3c and s5p console drivers 2011-07-20 19:10:43 +09:00
s3c2412.c serial: Remove redundant console_initcall from s3c and s5p console drivers 2011-07-20 19:10:43 +09:00
s3c2440.c serial: Remove redundant console_initcall from s3c and s5p console drivers 2011-07-20 19:10:43 +09:00
s3c6400.c serial: Remove redundant console_initcall from s3c and s5p console drivers 2011-07-20 19:10:43 +09:00
s5pv210.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
sa1100.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
samsung.c serial: samsung: Add unified interrupt handler for s3c64xx and later SoC's 2011-08-23 10:48:31 -07:00
samsung.h serial: samsung: Add unified interrupt handler for s3c64xx and later SoC's 2011-08-23 10:48:31 -07:00
sb1250-duart.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
sc26xx.c
serial_core.c TTY: serial: Move mutex_unlock in uart_close function 2011-09-22 15:47:53 -07:00
serial_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
serial_ks8695.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
serial_txx9.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
sh-sci.c sh: Fix boot crash related to SCI 2011-08-07 15:51:45 -07:00
sh-sci.h serial: sh-sci: FIFO sizing helper consolidation. 2011-06-14 17:38:19 +09:00
sn_console.c Fix common misspellings 2011-03-31 11:26:23 -03:00
suncore.c
suncore.h
sunhv.c dt/serial: Eliminate users of of_platform_{,un}register_driver 2011-02-28 13:22:46 -07:00
sunsab.c dt/serial: Eliminate users of of_platform_{,un}register_driver 2011-02-28 13:22:46 -07:00
sunsab.h
sunsu.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
sunzilog.c Fix common misspellings 2011-03-31 11:26:23 -03:00
sunzilog.h
timbuart.c
timbuart.h
uartlite.c dt: uartlite: merge platform and of_platform driver bindings 2011-02-28 13:22:43 -07:00
ucc_uart.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2011-03-18 06:31:43 -07:00
vr41xx_siu.c
vt8500_serial.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
xilinx_uartps.c tty/serial: add support for Xilinx PS UART 2011-05-03 10:26:39 -07:00
zs.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
zs.h