projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43eca0a
)
pty: Fix locking bug on error path
author
Alan Cox
<
[email protected]
>
Wed, 19 Sep 2012 14:34:47 +0000
(15:34 +0100)
committer
Greg Kroah-Hartman
<
[email protected]
>
Fri, 21 Sep 2012 16:51:09 +0000
(09:51 -0700)
We end up dropping the mutex twice on some errors. We don't want to do
that.
Reported-by: Fengguang Wu <
[email protected]
>
Signed-off-by: Alan Cox <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/tty/pty.c
patch
|
blob
|
history
diff --git
a/drivers/tty/pty.c
b/drivers/tty/pty.c
index 2bace847eb3973010f45848b48c8d28da351fd6b..a82b39939a9cab4fc02a6d6d0be13607284d68ce 100644
(file)
--- a/
drivers/tty/pty.c
+++ b/
drivers/tty/pty.c
@@
-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
@@
out:
mutex_unlock(&tty_mutex);
devpts_kill_index(inode, index);
err_file:
- mutex_unlock(&devpts_mutex);
tty_free_file(filp);
return retval;
}