Skip to content

Commit

Permalink
zd1211rw: remove URB_SHORT_NOT_OK flag in zd_usb_iowrite16v_async()
Browse files Browse the repository at this point in the history
Patch removes the bogus flag introduced by upstream commit
eefdbec. 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>
  • Loading branch information
Jussi Kivilinna authored and John W. Linville committed Apr 4, 2011
1 parent fcf8bd3 commit 2fc713b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/wireless/zd1211rw/zd_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2fc713b

Please sign in to comment.