aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/tty_io.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 49c1a2267a55..e94bee032314 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1215,10 +1215,11 @@ int tty_check_change(struct tty_struct *tty)
1215 1215
1216 if (!tty->pgrp) { 1216 if (!tty->pgrp) {
1217 printk(KERN_WARNING "tty_check_change: tty->pgrp == NULL!\n"); 1217 printk(KERN_WARNING "tty_check_change: tty->pgrp == NULL!\n");
1218 goto out; 1218 goto out_unlock;
1219 } 1219 }
1220 if (task_pgrp(current) == tty->pgrp) 1220 if (task_pgrp(current) == tty->pgrp)
1221 goto out; 1221 goto out_unlock;
1222 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
1222 if (is_ignored(SIGTTOU)) 1223 if (is_ignored(SIGTTOU))
1223 goto out; 1224 goto out;
1224 if (is_current_pgrp_orphaned()) { 1225 if (is_current_pgrp_orphaned()) {
@@ -1229,6 +1230,8 @@ int tty_check_change(struct tty_struct *tty)
1229 set_thread_flag(TIF_SIGPENDING); 1230 set_thread_flag(TIF_SIGPENDING);
1230 ret = -ERESTARTSYS; 1231 ret = -ERESTARTSYS;
1231out: 1232out:
1233 return ret;
1234out_unlock:
1232 spin_unlock_irqrestore(&tty->ctrl_lock, flags); 1235 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
1233 return ret; 1236 return ret;
1234} 1237}