Merge branch 'for-next' into for-linus
[safe/jmp/linux-2.6] / drivers / char / tty_io.c
index 56b11c1..a42c466 100644 (file)
@@ -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 {