aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 71d95cfbabec..c7561f29d894 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1163,10 +1163,8 @@ ssize_t redirected_tty_write(struct file *file, const char __user *buf,
1163 struct file *p = NULL; 1163 struct file *p = NULL;
1164 1164
1165 spin_lock(&redirect_lock); 1165 spin_lock(&redirect_lock);
1166 if (redirect) { 1166 if (redirect)
1167 get_file(redirect); 1167 p = get_file(redirect);
1168 p = redirect;
1169 }
1170 spin_unlock(&redirect_lock); 1168 spin_unlock(&redirect_lock);
1171 1169
1172 if (p) { 1170 if (p) {
@@ -2246,8 +2244,7 @@ static int tioccons(struct file *file)
2246 spin_unlock(&redirect_lock); 2244 spin_unlock(&redirect_lock);
2247 return -EBUSY; 2245 return -EBUSY;
2248 } 2246 }
2249 get_file(file); 2247 redirect = get_file(file);
2250 redirect = file;
2251 spin_unlock(&redirect_lock); 2248 spin_unlock(&redirect_lock);
2252 return 0; 2249 return 0;
2253} 2250}