Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee8da700 authored by Steven Cahail's avatar Steven Cahail
Browse files

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: default avatarSteven Cahail <scahail@codeaurora.org>
parent cfb69012
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
}