aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda')
-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 828f88603d6c..6b9d5a0e42f9 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) {