Ignore:
Timestamp:
Apr 16, 2017, 3:07:01 PM (5 weeks ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.18/drivers/usb/serial/digi_acceleport.c

    r29540 r31869  
    14841484        struct tty_struct *tty;
    14851485        struct digi_port *priv = usb_get_serial_port_data(port);
     1486        unsigned char *buf = urb->transfer_buffer;
    14861487        int opcode, line, status, val;
    14871488        int i;
    14881489        unsigned int rts;
    14891490
     1491        if (urb->actual_length < 4)
     1492                return -1;
     1493
    14901494        /* handle each oob command */
    1491         for (i = 0; i < urb->actual_length - 3;) {
    1492                 opcode = ((unsigned char *)urb->transfer_buffer)[i++];
    1493                 line = ((unsigned char *)urb->transfer_buffer)[i++];
    1494                 status = ((unsigned char *)urb->transfer_buffer)[i++];
    1495                 val = ((unsigned char *)urb->transfer_buffer)[i++];
     1495        for (i = 0; i < urb->actual_length - 3; i += 4) {
     1496                opcode = buf[i];
     1497                line = buf[i + 1];
     1498                status = buf[i + 2];
     1499                val = buf[i + 3];
    14961500
    14971501                dev_dbg(&port->dev, "digi_read_oob_callback: opcode=%d, line=%d, status=%d, val=%d\n",
Note: See TracChangeset for help on using the changeset viewer.