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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
44a1bfd95d
commit
410235fd4d
@@ -892,12 +892,12 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
|
||||
{
|
||||
struct r_port *info;
|
||||
struct tty_port *port;
|
||||
int line = 0, retval;
|
||||
int retval;
|
||||
CHANNEL_t *cp;
|
||||
unsigned long page;
|
||||
|
||||
line = tty->index;
|
||||
if (line < 0 || line >= MAX_RP_PORTS || ((info = rp_table[line]) == NULL))
|
||||
info = rp_table[tty->index];
|
||||
if (info == NULL)
|
||||
return -ENXIO;
|
||||
port = &info->port;
|
||||
|
||||
|
Reference in New Issue
Block a user