Commit dcf0c915 authored by Radostin Stoyanov's avatar Radostin Stoyanov Committed by Andrei Vagin

tty: Goto err when fail to unlock master pty

Signed-off-by: 's avatarRadostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@gmail.com>
parent 7549e93a
...@@ -997,7 +997,8 @@ static int pty_open_unpaired_slave(struct file_desc *d, struct tty_info *slave) ...@@ -997,7 +997,8 @@ static int pty_open_unpaired_slave(struct file_desc *d, struct tty_info *slave)
goto err; goto err;
} }
unlock_pty(master); if (unlock_pty(master))
goto err;
if (opts.orphan_pts_master && if (opts.orphan_pts_master &&
rpc_send_fd(ACT_ORPHAN_PTS_MASTER, master) == 0) { rpc_send_fd(ACT_ORPHAN_PTS_MASTER, master) == 0) {
...@@ -1036,7 +1037,8 @@ static int pty_open_unpaired_slave(struct file_desc *d, struct tty_info *slave) ...@@ -1036,7 +1037,8 @@ static int pty_open_unpaired_slave(struct file_desc *d, struct tty_info *slave)
goto err; goto err;
} }
unlock_pty(master); if (unlock_pty(master))
goto err;
fd = open_tty_reg(slave->reg_d, slave->tfe->flags); fd = open_tty_reg(slave->reg_d, slave->tfe->flags);
if (fd < 0) { if (fd < 0) {
...@@ -1103,7 +1105,8 @@ static int pty_open_ptmx(struct tty_info *info) ...@@ -1103,7 +1105,8 @@ static int pty_open_ptmx(struct tty_info *info)
return -1; return -1;
} }
unlock_pty(master); if (unlock_pty(master))
goto err;
if (restore_tty_params(master, info)) if (restore_tty_params(master, info))
goto err; goto err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment