diff options
Diffstat (limited to 'drivers/tty/cyclades.c')
-rw-r--r-- | drivers/tty/cyclades.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index bc7b5a5650ba..e61cabdd69df 100644 --- a/drivers/tty/cyclades.c +++ b/drivers/tty/cyclades.c | |||
@@ -1515,13 +1515,9 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty) | |||
1515 | static int cy_open(struct tty_struct *tty, struct file *filp) | 1515 | static int cy_open(struct tty_struct *tty, struct file *filp) |
1516 | { | 1516 | { |
1517 | struct cyclades_port *info; | 1517 | struct cyclades_port *info; |
1518 | unsigned int i, line; | 1518 | unsigned int i, line = tty->index; |
1519 | int retval; | 1519 | int retval; |
1520 | 1520 | ||
1521 | line = tty->index; | ||
1522 | if (tty->index < 0 || NR_PORTS <= line) | ||
1523 | return -ENODEV; | ||
1524 | |||
1525 | for (i = 0; i < NR_CARDS; i++) | 1521 | for (i = 0; i < NR_CARDS; i++) |
1526 | if (line < cy_card[i].first_line + cy_card[i].nports && | 1522 | if (line < cy_card[i].first_line + cy_card[i].nports && |
1527 | line >= cy_card[i].first_line) | 1523 | line >= cy_card[i].first_line) |