Commit 2149ab5c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: fix CHECKER found bug in the io_edgeport.c driver

parent d7a467e9
...@@ -1356,6 +1356,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -1356,6 +1356,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
} else { } else {
memcpy(&fifo->fifo[fifo->head], data, firsthalf); memcpy(&fifo->fifo[fifo->head], data, firsthalf);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, firsthalf, &fifo->fifo[fifo->head]);
// update the index and size // update the index and size
fifo->head += firsthalf; fifo->head += firsthalf;
...@@ -1376,16 +1377,13 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign ...@@ -1376,16 +1377,13 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
} else { } else {
memcpy(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf); memcpy(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf);
} }
usb_serial_debug_data (__FILE__, __FUNCTION__, secondhalf, &fifo->fifo[fifo->head]);
// update the index and size // update the index and size
fifo->count += secondhalf; fifo->count += secondhalf;
fifo->head += secondhalf; fifo->head += secondhalf;
// No need to check for wrap since we can not get to end of fifo in this part // No need to check for wrap since we can not get to end of fifo in this part
} }
if (copySize) {
usb_serial_debug_data (__FILE__, __FUNCTION__, copySize, data);
}
send_more_port_data((struct edgeport_serial *)usb_get_serial_data(port->serial), edge_port); send_more_port_data((struct edgeport_serial *)usb_get_serial_data(port->serial), edge_port);
dbg("%s wrote %d byte(s) TxCredits %d, Fifo %d", __FUNCTION__, copySize, edge_port->txCredits, fifo->count); dbg("%s wrote %d byte(s) TxCredits %d, Fifo %d", __FUNCTION__, copySize, edge_port->txCredits, fifo->count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment