Index: drivers/usb/class/cdc-acm.c =================================================================== RCS file: /home/cvsroot/linuxppc/drivers/usb/class/cdc-acm.c,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 cdc-acm.c --- drivers/usb/class/cdc-acm.c 8 Jan 2004 11:25:51 -0000 1.1.1.1 +++ drivers/usb/class/cdc-acm.c 13 Jan 2004 11:59:28 -0000 @@ -45,7 +45,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#undef DEBUG +#define DEBUG #include #include @@ -530,7 +530,7 @@ struct termios *termios = tty->termios; struct acm_line newline; int newctrl = acm->ctrlout; - + int offset = 0; if (!ACM_READY(acm)) return; @@ -539,7 +539,13 @@ newline.stopbits = termios->c_cflag & CSTOPB ? 2 : 0; newline.parity = termios->c_cflag & PARENB ? (termios->c_cflag & PARODD ? 1 : 2) + (termios->c_cflag & CMSPAR ? 2 : 0) : 0; - newline.databits = acm_tty_size[(termios->c_cflag & CSIZE) >> 4]; + + offset = (termios->c_cflag & CSIZE) >> 4; + if (offset >= sizeof(acm_tty_size)) { + dbg("databits index too high: %d\n", offset); + offset = 3; + } + newline.databits = acm_tty_size[offset]; acm->clocal = ((termios->c_cflag & CLOCAL) != 0);