aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/moxa.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 08:57:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 08:57:47 -0700
commit49c355617f603b8e71ec117c1f940152a998528a (patch)
tree6b5e373003371bbe8c587a9fdda7bc4f0e791b03 /drivers/char/moxa.c
parent991ec02cdca33b03a132a0cacfe6f0aa0be9aa8d (diff)
parentf0e8527726b9e56649b9eafde3bc0fbc4dd2dd47 (diff)
Merge branch 'serial-from-alan'
* serial-from-alan: (79 commits) moxa: prevent opening unavailable ports imx: serial: use tty_encode_baud_rate to set true rate imx: serial: add IrDA support to serial driver imx: serial: use rational library function lib: isolate rational fractions helper function imx: serial: handle initialisation failure correctly imx: serial: be sure to stop xmit upon shutdown imx: serial: notify higher layers in case xmit IRQ was not called imx: serial: fix one bit field type imx: serial: fix whitespaces (no changes in functionality) tty: use prepare/finish_wait tty: remove sleep_on sierra: driver interface blacklisting sierra: driver urb handling improvements tty: resolve some sierra breakage timbuart: Fix the termios logic serial: Added Timberdale UART driver tty: Add URL for ttydev queue devpts: unregister the file system on error tty: Untangle termios and mm mutex dependencies ...
Diffstat (limited to 'drivers/char/moxa.c')
-rw-r--r--drivers/char/moxa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 4a4cab73d0b..65b6ff2442c 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -1184,6 +1184,11 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
return -ENODEV;
}
+ if (port % MAX_PORTS_PER_BOARD >= brd->numPorts) {
+ mutex_unlock(&moxa_openlock);
+ return -ENODEV;
+ }
+
ch = &brd->ports[port % MAX_PORTS_PER_BOARD];
ch->port.count++;
tty->driver_data = ch;