diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-10-09 15:19:27 (GMT) |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2014-03-04 23:38:04 (GMT) |
commit | 5ec9c1771ce83a1e2b7ec96ed9f29a9f1b25e71e (patch) | |
tree | f4a0e79c35b289436798007ff06c83b5006cf52f /drivers/usb | |
parent | 6343e8bf09de16ab4dcae2c6ca1a0e8dbd4dd770 (diff) | |
download | linux-5ec9c1771ce83a1e2b7ec96ed9f29a9f1b25e71e.tar.xz |
usbfs: Kill urbs on interface before doing a set_interface
The usb_set_interface documentation says:
* Also, drivers must not change altsettings while urbs are scheduled for
* endpoints in that interface; all such urbs must first be completed
* (perhaps forced by unlinking).
For in kernel drivers we trust the drivers to get this right, but we
cannot trust userspace to get this right, so enforce it by killing any
urbs still pending on the interface.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/devio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index f3ba2e0..2a95e4e 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1143,6 +1143,9 @@ static int proc_setintf(struct dev_state *ps, void __user *arg) return -EFAULT; if ((ret = checkintf(ps, setintf.interface))) return ret; + + destroy_async_on_interface(ps, setintf.interface); + return usb_set_interface(ps->dev, setintf.interface, setintf.altsetting); } |