]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: omninet: fix write_room
authorJohan Hovold <jhovold@gmail.com>
Sun, 6 Nov 2011 18:06:21 +0000 (19:06 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Jan 2012 19:40:08 +0000 (11:40 -0800)
commit 694c6301e515bad574af74b6552134c4d9dcb334 upstream.

Fix regression introduced by commit 507ca9bc047666 ([PATCH] USB: add
ability for usb-serial drivers to determine if their write urb is
currently being used.) which inverted the logic in write_room so that it
returns zero when the write urb is actually free.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/omninet.c

index 062265038bf0cd57ec11972af1aafdfed8899aa4..c116bd90e0e1e25bf6d0d35c11bd4986340d53e2 100644 (file)
@@ -317,7 +317,7 @@ static int omninet_write_room(struct tty_struct *tty)
        int room = 0; /* Default: no room */
 
        /* FIXME: no consistent locking for write_urb_busy */
-       if (wport->write_urb_busy)
+       if (!wport->write_urb_busy)
                room = wport->bulk_out_size - OMNINET_HEADERLEN;
 
        dbg("%s - returns %d", __func__, room);