aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/ircomm
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-03-05 08:52:01 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 14:42:21 -0500
commit410235fd4d20b8feaf8930a0575d23acc088aa87 (patch)
treead21d071a29ef0ad400393328ca4ab0588d5b2b7 /net/irda/ircomm
parent44a1bfd95d0a6c0096e79a883197596e1ce83cc3 (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 'net/irda/ircomm')
-rw-r--r--net/irda/ircomm/ircomm_tty.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 828f88603d6..6b9d5a0e42f 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -365,16 +365,12 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
365static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) 365static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
366{ 366{
367 struct ircomm_tty_cb *self; 367 struct ircomm_tty_cb *self;
368 unsigned int line; 368 unsigned int line = tty->index;
369 unsigned long flags; 369 unsigned long flags;
370 int ret; 370 int ret;
371 371
372 IRDA_DEBUG(2, "%s()\n", __func__ ); 372 IRDA_DEBUG(2, "%s()\n", __func__ );
373 373
374 line = tty->index;
375 if (line >= IRCOMM_TTY_PORTS)
376 return -ENODEV;
377
378 /* Check if instance already exists */ 374 /* Check if instance already exists */
379 self = hashbin_lock_find(ircomm_tty, line, NULL); 375 self = hashbin_lock_find(ircomm_tty, line, NULL);
380 if (!self) { 376 if (!self) {