提交 05fb79e4 编写于 作者: A Alan Cox 提交者: Greg Kroah-Hartman

pty: Fix locking bug on error path

We end up dropping the mutex twice on some errors. We don't want to do
that.
Reported-by: NFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 43eca0ae
......@@ -628,6 +628,7 @@ static int ptmx_open(struct inode *inode, struct file *filp)
index = devpts_new_index(inode);
if (index < 0) {
retval = index;
mutex_unlock(&devpts_mutex);
goto err_file;
}
......@@ -667,7 +668,6 @@ static int ptmx_open(struct inode *inode, struct file *filp)
mutex_unlock(&tty_mutex);
devpts_kill_index(inode, index);
err_file:
mutex_unlock(&devpts_mutex);
tty_free_file(filp);
return retval;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册