Skip to content

Commit

Permalink
Merge tag 'tty-3.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/gregkh/tty

Pul tty fixes from Greg Kroah-Hartman:
 "Here are two tty core fixes that resolve some regressions that have
  been reported recently.  Both tiny fixes, but needed"

* tag 'tty-3.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  tty: Fix transient pty write() EIO
  tty/vt: Return EBUSY if deallocating VT1 and it is busy
  • Loading branch information
Linus Torvalds committed Jun 22, 2013
2 parents 67e5b2f + 7c61c3d commit dcfdc28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
13 changes: 5 additions & 8 deletions drivers/tty/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,9 @@ static void pty_flush_buffer(struct tty_struct *tty)

static int pty_open(struct tty_struct *tty, struct file *filp)
{
int retval = -ENODEV;

if (!tty || !tty->link)
goto out;

set_bit(TTY_IO_ERROR, &tty->flags);
return -ENODEV;

retval = -EIO;
if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
goto out;
if (test_bit(TTY_PTY_LOCK, &tty->link->flags))
Expand All @@ -262,9 +257,11 @@ static int pty_open(struct tty_struct *tty, struct file *filp)
clear_bit(TTY_IO_ERROR, &tty->flags);
clear_bit(TTY_OTHER_CLOSED, &tty->link->flags);
set_bit(TTY_THROTTLED, &tty->flags);
retval = 0;
return 0;

out:
return retval;
set_bit(TTY_IO_ERROR, &tty->flags);
return -EIO;
}

static void pty_set_termios(struct tty_struct *tty,
Expand Down
5 changes: 1 addition & 4 deletions drivers/tty/vt/vt_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,10 @@ static int vt_disallocate(unsigned int vc_num)
struct vc_data *vc = NULL;
int ret = 0;

if (!vc_num)
return 0;

console_lock();
if (VT_BUSY(vc_num))
ret = -EBUSY;
else
else if (vc_num)
vc = vc_deallocate(vc_num);
console_unlock();

Expand Down

0 comments on commit dcfdc28

Please sign in to comment.