Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325631
b: refs/heads/master
c: 00aaae0
h: refs/heads/master
i:
  325629: 76c99ff
  325627: 05845ce
  325623: af4a4de
  325615: 417b77f
  325599: ed92331
  325567: cf75ad9
  325503: 7aa9e09
  325375: eaca102
  325119: 4aef51d
  324607: 3e275cd
  323583: 375e9e5
v: v3
  • Loading branch information
Stanislav Kozina authored and Greg Kroah-Hartman committed Aug 10, 2012
1 parent 837a61b commit 5c660b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 857196e2758f01ec40f93429013963ca5f22cbae
refs/heads/master: 00aaae033e323af33740e7012a8ba4b0fa6dce20
6 changes: 5 additions & 1 deletion trunk/drivers/tty/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1838,13 +1838,13 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,

if (tty->icanon && !L_EXTPROC(tty)) {
/* N.B. avoid overrun if nr == 0 */
spin_lock_irqsave(&tty->read_lock, flags);
while (nr && tty->read_cnt) {
int eol;

eol = test_and_clear_bit(tty->read_tail,
tty->read_flags);
c = tty->read_buf[tty->read_tail];
spin_lock_irqsave(&tty->read_lock, flags);
tty->read_tail = ((tty->read_tail+1) &
(N_TTY_BUF_SIZE-1));
tty->read_cnt--;
Expand All @@ -1862,15 +1862,19 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
if (tty_put_user(tty, c, b++)) {
retval = -EFAULT;
b--;
spin_lock_irqsave(&tty->read_lock, flags);
break;
}
nr--;
}
if (eol) {
tty_audit_push(tty);
spin_lock_irqsave(&tty->read_lock, flags);
break;
}
spin_lock_irqsave(&tty->read_lock, flags);
}
spin_unlock_irqrestore(&tty->read_lock, flags);
if (retval)
break;
} else {
Expand Down

0 comments on commit 5c660b6

Please sign in to comment.