zd1211rw: remove URB_SHORT_NOT_OK flag in zd_usb_iowrite16v_async()
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Fri, 1 Apr 2011 16:34:08 +0000 (19:34 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 4 Apr 2011 19:22:12 +0000 (15:22 -0400)
Patch removes the bogus flag introduced by upstream commit
eefdbec1ea8b7093d2c09d1825f68438701723cf. Old code had buffer length check
that new code tried to handle with URB_SHORT_NOT_OK flag. With USB debugging
enabled bogus flag caused usb_submit_urb fail.

Remove URB_SHORT_NOT_OK flag and add buffer length check to urb completion
handler.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=32092
Reported-by: Jonathan Callen <abcd@gentoo.org>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/zd1211rw/zd_usb.c

index 58236e6d0921308f72e55accc7676bca0c64f42d..9b1a26a4435b5963919664ddf879a38183a450f9 100644 (file)
@@ -1671,6 +1671,10 @@ static void iowrite16v_urb_complete(struct urb *urb)
 
        if (urb->status && !usb->cmd_error)
                usb->cmd_error = urb->status;
+
+       if (!usb->cmd_error &&
+                       urb->actual_length != urb->transfer_buffer_length)
+               usb->cmd_error = -EIO;
 }
 
 static int zd_submit_waiting_urb(struct zd_usb *usb, bool last)
@@ -1805,7 +1809,7 @@ int zd_usb_iowrite16v_async(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs,
        usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT),
                         req, req_len, iowrite16v_urb_complete, usb,
                         ep->desc.bInterval);
-       urb->transfer_flags |= URB_FREE_BUFFER | URB_SHORT_NOT_OK;
+       urb->transfer_flags |= URB_FREE_BUFFER;
 
        /* Submit previous URB */
        r = zd_submit_waiting_urb(usb, false);