diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-03-05 08:52:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-08 14:42:21 -0500 |
commit | 410235fd4d20b8feaf8930a0575d23acc088aa87 (patch) | |
tree | ad21d071a29ef0ad400393328ca4ab0588d5b2b7 /drivers/isdn/i4l | |
parent | 44a1bfd95d0a6c0096e79a883197596e1ce83cc3 (diff) |
TTY: remove unneeded tty->index checks
Checking if tty->index is in bounds is not needed. The tty has the
index set in the initial open. This is done in get_tty_driver. And it
can be only in interval <0,driver->num).
So remove the tests which check exactly this interval. Some are
left untouched as they check against the current backing device count.
(Leaving apart that the check is racy in most of the cases.)
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/isdn/i4l')
-rw-r--r-- | drivers/isdn/i4l/isdn_tty.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 2c26b64ebbea..ac4840124bc0 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -1590,12 +1590,9 @@ static int | |||
1590 | isdn_tty_open(struct tty_struct *tty, struct file *filp) | 1590 | isdn_tty_open(struct tty_struct *tty, struct file *filp) |
1591 | { | 1591 | { |
1592 | modem_info *info; | 1592 | modem_info *info; |
1593 | int retval, line; | 1593 | int retval; |
1594 | 1594 | ||
1595 | line = tty->index; | 1595 | info = &dev->mdm.info[tty->index]; |
1596 | if (line < 0 || line >= ISDN_MAX_CHANNELS) | ||
1597 | return -ENODEV; | ||
1598 | info = &dev->mdm.info[line]; | ||
1599 | if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_open")) | 1596 | if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_open")) |
1600 | return -ENODEV; | 1597 | return -ENODEV; |
1601 | if (!try_module_get(info->owner)) { | 1598 | if (!try_module_get(info->owner)) { |