diff options
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r-- | drivers/tty/n_tty.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index f27289d910b2..ceae0744cbb8 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -1375,9 +1375,6 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
1375 | char buf[64]; | 1375 | char buf[64]; |
1376 | unsigned long cpuflags; | 1376 | unsigned long cpuflags; |
1377 | 1377 | ||
1378 | if (!tty->read_buf) | ||
1379 | return; | ||
1380 | |||
1381 | if (tty->real_raw) { | 1378 | if (tty->real_raw) { |
1382 | spin_lock_irqsave(&tty->read_lock, cpuflags); | 1379 | spin_lock_irqsave(&tty->read_lock, cpuflags); |
1383 | i = min(N_TTY_BUF_SIZE - tty->read_cnt, | 1380 | i = min(N_TTY_BUF_SIZE - tty->read_cnt, |
@@ -1471,7 +1468,6 @@ int is_ignored(int sig) | |||
1471 | static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old) | 1468 | static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old) |
1472 | { | 1469 | { |
1473 | int canon_change = 1; | 1470 | int canon_change = 1; |
1474 | BUG_ON(!tty); | ||
1475 | 1471 | ||
1476 | if (old) | 1472 | if (old) |
1477 | canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON; | 1473 | canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON; |
@@ -1579,9 +1575,6 @@ static void n_tty_close(struct tty_struct *tty) | |||
1579 | 1575 | ||
1580 | static int n_tty_open(struct tty_struct *tty) | 1576 | static int n_tty_open(struct tty_struct *tty) |
1581 | { | 1577 | { |
1582 | if (!tty) | ||
1583 | return -EINVAL; | ||
1584 | |||
1585 | /* These are ugly. Currently a malloc failure here can panic */ | 1578 | /* These are ugly. Currently a malloc failure here can panic */ |
1586 | tty->read_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); | 1579 | tty->read_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); |
1587 | tty->echo_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); | 1580 | tty->echo_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); |
@@ -1736,10 +1729,6 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, | |||
1736 | int packet; | 1729 | int packet; |
1737 | 1730 | ||
1738 | do_it_again: | 1731 | do_it_again: |
1739 | |||
1740 | if (WARN_ON(!tty->read_buf)) | ||
1741 | return -EAGAIN; | ||
1742 | |||
1743 | c = job_control(tty, file); | 1732 | c = job_control(tty, file); |
1744 | if (c < 0) | 1733 | if (c < 0) |
1745 | return c; | 1734 | return c; |
@@ -1825,7 +1814,6 @@ do_it_again: | |||
1825 | /* FIXME: does n_tty_set_room need locking ? */ | 1814 | /* FIXME: does n_tty_set_room need locking ? */ |
1826 | n_tty_set_room(tty); | 1815 | n_tty_set_room(tty); |
1827 | timeout = schedule_timeout(timeout); | 1816 | timeout = schedule_timeout(timeout); |
1828 | BUG_ON(!tty->read_buf); | ||
1829 | continue; | 1817 | continue; |
1830 | } | 1818 | } |
1831 | __set_current_state(TASK_RUNNING); | 1819 | __set_current_state(TASK_RUNNING); |