Commit 2fc713b2 authored by Jussi Kivilinna's avatar Jussi Kivilinna Committed by John W. Linville

zd1211rw: remove URB_SHORT_NOT_OK flag in zd_usb_iowrite16v_async()

Patch removes the bogus flag introduced by upstream commit
eefdbec1. 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=32092Reported-by: default avatarJonathan Callen <abcd@gentoo.org>
Signed-off-by: default avatarJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent fcf8bd3b
...@@ -1671,6 +1671,10 @@ static void iowrite16v_urb_complete(struct urb *urb) ...@@ -1671,6 +1671,10 @@ static void iowrite16v_urb_complete(struct urb *urb)
if (urb->status && !usb->cmd_error) if (urb->status && !usb->cmd_error)
usb->cmd_error = urb->status; 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) 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, ...@@ -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), usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT),
req, req_len, iowrite16v_urb_complete, usb, req, req_len, iowrite16v_urb_complete, usb,
ep->desc.bInterval); ep->desc.bInterval);
urb->transfer_flags |= URB_FREE_BUFFER | URB_SHORT_NOT_OK; urb->transfer_flags |= URB_FREE_BUFFER;
/* Submit previous URB */ /* Submit previous URB */
r = zd_submit_waiting_urb(usb, false); r = zd_submit_waiting_urb(usb, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment