diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-05-31 12:02:43 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-05-31 12:02:43 +0800 |
commit | a898540914d4136f29bc738ce593c1c501006f23 (patch) | |
tree | 9440b7f76c029143611c89ed919718ba6ff353f4 /drivers/usb/serial/io_ti.c | |
parent | d97f745e1d2fea4d2f308e5e06eee81a9a84f3f5 (diff) | |
parent | 56d847e3ef9433d7ac92376e4ba49d3cf3cb70d2 (diff) |
Merge tag 'v4.1.40' into linux-linaro-lsk-v4.1lsk-v4.1-17.06lsk-v4.1-17.05linux-linaro-lsk-v4.1
This is the 4.1.40 stable release
Diffstat (limited to 'drivers/usb/serial/io_ti.c')
-rw-r--r-- | drivers/usb/serial/io_ti.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 2ef757f35162..dbc2073d8282 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -1546,6 +1546,12 @@ static void edge_interrupt_callback(struct urb *urb) function = TIUMP_GET_FUNC_FROM_CODE(data[0]); dev_dbg(dev, "%s - port_number %d, function %d, info 0x%x\n", __func__, port_number, function, data[1]); + + if (port_number >= edge_serial->serial->num_ports) { + dev_err(dev, "bad port number %d\n", port_number); + goto exit; + } + port = edge_serial->serial->port[port_number]; edge_port = usb_get_serial_port_data(port); if (!edge_port) { @@ -1626,7 +1632,7 @@ static void edge_bulk_in_callback(struct urb *urb) port_number = edge_port->port->port_number; - if (edge_port->lsr_event) { + if (urb->actual_length > 0 && edge_port->lsr_event) { edge_port->lsr_event = 0; dev_dbg(dev, "%s ===== Port %u LSR Status = %02x, Data = %02x ======\n", __func__, port_number, edge_port->lsr_mask, *data); |