ChangeSet 1.1504.2.45, 2003/12/12 11:03:38-08:00, [EMAIL PROTECTED] [PATCH] USB: fix bug when errors happen in ioedgeport driver
drivers/usb/serial/io_edgeport.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c --- a/drivers/usb/serial/io_edgeport.c Mon Dec 29 14:21:58 2003 +++ b/drivers/usb/serial/io_edgeport.c Mon Dec 29 14:21:58 2003 @@ -1488,16 +1488,20 @@ usb_sndbulkpipe(edge_serial->serial->dev, edge_serial->bulk_out_endpoint), buffer, count+2, edge_bulk_out_data_callback, edge_port); + /* decrement the number of credits we have by the number we just sent */ + edge_port->txCredits -= count; + edge_port->icount.tx += count; + urb->dev = edge_serial->serial->dev; status = usb_submit_urb(urb, GFP_ATOMIC); if (status) { /* something went wrong */ dbg("%s - usb_submit_urb(write bulk) failed", __FUNCTION__); edge_port->write_in_progress = FALSE; - } else { - /* decrement the number of credits we have by the number we just sent */ - edge_port->txCredits -= count; - edge_port->icount.tx += count; + + /* revert the credits as something bad happened. */ + edge_port->txCredits += count; + edge_port->icount.tx -= count; } dbg("%s wrote %d byte(s) TxCredit %d, Fifo %d", __FUNCTION__, count, edge_port->txCredits, fifo->count); } ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel