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>
Tue, 15 Nov 2011 18:33:10 +0000 (10:33 -0800)
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>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/omninet.c

index 6d7c56d0cb61199e9db2f06dc7114397fa37610d..6e976649fcae4c8554500802ccde05843fc9d0ed 100644 (file)
@@ -290,7 +290,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);