summaryrefslogtreecommitdiff
path: root/drivers/staging/speakup/serialio.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-01 20:50:26 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-01 20:50:26 (GMT)
commit4cff7adbebf4d25f662b13c6582b945d9d549e25 (patch)
treecfb6bc0aaab6ad7fa7ca2bb07453ed2fd139138c /drivers/staging/speakup/serialio.c
parent7e3933df9874b70745548ce9177295d11c58fc21 (diff)
parent36f90b0a2ddd60823fe193a85e60ff1906c2a9b3 (diff)
downloadlinux-4cff7adbebf4d25f662b13c6582b945d9d549e25.tar.xz
Merge 4.5-rc2 into staging-next
This fixes a merge issue with the panel driver, and picks up fixes in iio and other drivers that we want here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/speakup/serialio.c')
-rw-r--r--drivers/staging/speakup/serialio.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c
index 3b5835b..a5bbb33 100644
--- a/drivers/staging/speakup/serialio.c
+++ b/drivers/staging/speakup/serialio.c
@@ -6,6 +6,11 @@
#include "spk_priv.h"
#include "serialio.h"
+#include <linux/serial_core.h>
+/* WARNING: Do not change this to <linux/serial.h> without testing that
+ * SERIAL_PORT_DFNS does get defined to the appropriate value. */
+#include <asm/serial.h>
+
#ifndef SERIAL_PORT_DFNS
#define SERIAL_PORT_DFNS
#endif
@@ -23,9 +28,15 @@ const struct old_serial_port *spk_serial_init(int index)
int baud = 9600, quot = 0;
unsigned int cval = 0;
int cflag = CREAD | HUPCL | CLOCAL | B9600 | CS8;
- const struct old_serial_port *ser = rs_table + index;
+ const struct old_serial_port *ser;
int err;
+ if (index >= ARRAY_SIZE(rs_table)) {
+ pr_info("no port info for ttyS%d\n", index);
+ return NULL;
+ }
+ ser = rs_table + index;
+
/* Divisor, bytesize and parity */
quot = ser->baud_base / baud;
cval = cflag & (CSIZE | CSTOPB);