diff options
author | Steven Cahail <scahail@codeaurora.org> | 2014-03-03 17:23:18 -0700 |
---|---|---|
committer | Steven Cahail <scahail@codeaurora.org> | 2014-03-04 09:05:17 -0700 |
commit | ee8da70063cf876b33ccdf83ecf882f19dd5790f (patch) | |
tree | beb1545bec7520ed2255c179fd9eafe590351a48 /drivers/tty | |
parent | cfb69012cbdd25ff6a3b5d56465536a3cd2cec67 (diff) |
TTY: msm_smd_tty: Fix simultaneous open/close race condition
smd_tty_close currently has a variable that depends on a race
condition with tty_port_open. This causes a null-pointer dereference
when the same port is simultaneously being opened/closed.
Use data from a static array instead of the variable to eliminate
the race condition.
CRs-Fixed: 624398
Change-Id: Ie55d37feaadd3a15f64e18501cd3af19145dbc8e
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/msm_smd_tty.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/msm_smd_tty.c b/drivers/tty/serial/msm_smd_tty.c index 39f417e94b4b..67edaf557a43 100644 --- a/drivers/tty/serial/msm_smd_tty.c +++ b/drivers/tty/serial/msm_smd_tty.c @@ -708,7 +708,7 @@ static int smd_tty_open(struct tty_struct *tty, struct file *f) static void smd_tty_close(struct tty_struct *tty, struct file *f) { - struct smd_tty_info *info = tty->driver_data; + struct smd_tty_info *info = smd_tty + tty->index; tty_port_close(&info->port, tty, f); } |