projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix race in tty_fasync() properly
[linux-2.6-block.git]
/
drivers
/
char
/
tty_io.c
diff --git
a/drivers/char/tty_io.c
b/drivers/char/tty_io.c
index c6f3b48be9dd68cc37c4847eb8cab4b268ec4c90..dcb9083ecde0982dd061720be8e2e324d3bde5ed 100644
(file)
--- a/
drivers/char/tty_io.c
+++ b/
drivers/char/tty_io.c
@@
-1951,8
+1951,10
@@
static int tty_fasync(int fd, struct file *filp, int on)
pid = task_pid(current);
type = PIDTYPE_PID;
}
-
retval = __f_setown(filp, pid, type, 0
);
+
get_pid(pid
);
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
+ retval = __f_setown(filp, pid, type, 0);
+ put_pid(pid);
if (retval)
goto out;
} else {