mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
USB: yurex: fix control-URB timeout handling
Make sure to always cancel the control URB in write() so that it can be
reused after a timeout or spurious CMD_ACK.
Currently any further write requests after a timeout would fail after
triggering a WARN() in usb_submit_urb() when attempting to submit the
already active URB.
Reported-by: [email protected]
Fixes: 6bc235a2e2 ("USB: add driver for Meywa-Denki & Kayac YUREX")
Cc: stable <[email protected]> # 2.6.37
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
1 parent
83a43ff80a
commit
372c931319
1 file changed
+3
@@ -496,6 +496,9 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer,
|
||||
timeout = schedule_timeout(YUREX_WRITE_TIMEOUT);
|
||||
finish_wait(&dev->waitq, &wait);
|
||||
|
||||
/* make sure URB is idle after timeout or (spurious) CMD_ACK */
|
||||
usb_kill_urb(dev->cntl_urb);
|
||||
|
||||
mutex_unlock(&dev->io_mutex);
|
||||
|
||||
if (retval < 0) {
|
||||
|
||||
Reference in new issue
Block a user