aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2011-04-20 04:43:16 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-25 17:19:11 -0400
commit32ad3a77b256948a326c3f68db6acaad2b6953e7 (patch)
tree18db761371c8875bcb1bd68d5e56ff4389aa96f4 /drivers/tty
parent0ad7c9af3e1cbb97082062266705d6cb5fb207ee (diff)
TTY: serial_core, remove invalid test
tty->index (named here as line) is set up in initialize_tty_struct. The value is checked in get_tty_driver for the found driver as: if (device < base || device >= base + p->num) continue; *index = device - base; So index/line can never be more than driver->num. Hence remove this test from uart_open. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/serial_core.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 55965d5b8143..69d00008f7a3 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1530,15 +1530,6 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
1530 pr_debug("uart_open(%d) called\n", line); 1530 pr_debug("uart_open(%d) called\n", line);
1531 1531
1532 /* 1532 /*
1533 * tty->driver->num won't change, so we won't fail here with
1534 * tty->driver_data set to something non-NULL (and therefore
1535 * we won't get caught by uart_close()).
1536 */
1537 retval = -ENODEV;
1538 if (line >= tty->driver->num)
1539 goto fail;
1540
1541 /*
1542 * We take the semaphore inside uart_get to guarantee that we won't 1533 * We take the semaphore inside uart_get to guarantee that we won't
1543 * be re-entered while allocating the state structure, or while we 1534 * be re-entered while allocating the state structure, or while we
1544 * request any IRQs that the driver may need. This also has the nice 1535 * request any IRQs that the driver may need. This also has the nice