From: Johan Hovold <jo...@kernel.org>

commit c01d2c58698f710c9e13ba3e2d296328606f74fd upstream.

Make sure to clear the write-busy flag also in case no new data was
submitted due to lack of device buffer space so that writing is
resumed once space again becomes available.

Fixes: 507ca9bc0476 ("[PATCH] USB: add ability for usb-serial drivers to 
determine if their write urb is currently being used.")
Cc: stable <sta...@vger.kernel.org>     # 2.6.13
Acked-by: Sebastian Andrzej Siewior <bige...@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Signed-off-by: Johan Hovold <jo...@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 drivers/usb/serial/keyspan_pda.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -552,7 +552,7 @@ static int keyspan_pda_write(struct tty_
 
        rc = count;
 exit:
-       if (rc < 0)
+       if (rc <= 0)
                set_bit(0, &port->write_urbs_free);
        return rc;
 }


Reply via email to