diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-22 15:00:28 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-22 15:00:28 -0400 |
| commit | dcfdc28f300380ad31033aa0bfb8cf80f23c453a (patch) | |
| tree | 14fdc07ba17f7bb920057c785cf77c06d1039ca4 | |
| parent | 67e5b2fad4e9848a954fd97de0509ec5cb6e6d47 (diff) | |
| parent | 7c61c3d8f44d5d822f758754287af644307b4af9 (diff) | |
Merge tag 'tty-3.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/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
| -rw-r--r-- | drivers/tty/pty.c | 13 | ||||
| -rw-r--r-- | drivers/tty/vt/vt_ioctl.c | 5 |
2 files changed, 6 insertions, 12 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 59bfaecc4e14..abfd99089781 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c | |||
| @@ -244,14 +244,9 @@ static void pty_flush_buffer(struct tty_struct *tty) | |||
| 244 | 244 | ||
| 245 | static int pty_open(struct tty_struct *tty, struct file *filp) | 245 | static int pty_open(struct tty_struct *tty, struct file *filp) |
| 246 | { | 246 | { |
| 247 | int retval = -ENODEV; | ||
| 248 | |||
| 249 | if (!tty || !tty->link) | 247 | if (!tty || !tty->link) |
| 250 | goto out; | 248 | return -ENODEV; |
| 251 | |||
| 252 | set_bit(TTY_IO_ERROR, &tty->flags); | ||
| 253 | 249 | ||
| 254 | retval = -EIO; | ||
| 255 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) | 250 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) |
| 256 | goto out; | 251 | goto out; |
| 257 | if (test_bit(TTY_PTY_LOCK, &tty->link->flags)) | 252 | if (test_bit(TTY_PTY_LOCK, &tty->link->flags)) |
| @@ -262,9 +257,11 @@ static int pty_open(struct tty_struct *tty, struct file *filp) | |||
| 262 | clear_bit(TTY_IO_ERROR, &tty->flags); | 257 | clear_bit(TTY_IO_ERROR, &tty->flags); |
| 263 | clear_bit(TTY_OTHER_CLOSED, &tty->link->flags); | 258 | clear_bit(TTY_OTHER_CLOSED, &tty->link->flags); |
| 264 | set_bit(TTY_THROTTLED, &tty->flags); | 259 | set_bit(TTY_THROTTLED, &tty->flags); |
| 265 | retval = 0; | 260 | return 0; |
| 261 | |||
| 266 | out: | 262 | out: |
| 267 | return retval; | 263 | set_bit(TTY_IO_ERROR, &tty->flags); |
| 264 | return -EIO; | ||
| 268 | } | 265 | } |
| 269 | 266 | ||
| 270 | static void pty_set_termios(struct tty_struct *tty, | 267 | static void pty_set_termios(struct tty_struct *tty, |
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c index fc2c06c66e89..2bd78e2ac8ec 100644 --- a/drivers/tty/vt/vt_ioctl.c +++ b/drivers/tty/vt/vt_ioctl.c | |||
| @@ -289,13 +289,10 @@ static int vt_disallocate(unsigned int vc_num) | |||
| 289 | struct vc_data *vc = NULL; | 289 | struct vc_data *vc = NULL; |
| 290 | int ret = 0; | 290 | int ret = 0; |
| 291 | 291 | ||
| 292 | if (!vc_num) | ||
| 293 | return 0; | ||
| 294 | |||
| 295 | console_lock(); | 292 | console_lock(); |
| 296 | if (VT_BUSY(vc_num)) | 293 | if (VT_BUSY(vc_num)) |
| 297 | ret = -EBUSY; | 294 | ret = -EBUSY; |
| 298 | else | 295 | else if (vc_num) |
| 299 | vc = vc_deallocate(vc_num); | 296 | vc = vc_deallocate(vc_num); |
| 300 | console_unlock(); | 297 | console_unlock(); |
| 301 | 298 | ||
