Commit 16443d6c authored by Duncan Sands's avatar Duncan Sands Committed by Greg Kroah-Hartman

[PATCH] USB usbfs: drop pointless racy check

The check of interface->dev.driver requires a lock to be taken
to protect against driver binding changes.  But in fact I think it
is better just to drop the test.  The result is that the caller is
required to claim an interface before changing the altsetting,
which is consistent with the other routines that operate on
interfaces.

 devio.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
parent c057908f
...@@ -747,10 +747,8 @@ static int proc_setintf(struct dev_state *ps, void __user *arg) ...@@ -747,10 +747,8 @@ static int proc_setintf(struct dev_state *ps, void __user *arg)
if ((ret = findintfif(ps->dev, setintf.interface)) < 0) if ((ret = findintfif(ps->dev, setintf.interface)) < 0)
return ret; return ret;
interface = ps->dev->actconfig->interface[ret]; interface = ps->dev->actconfig->interface[ret];
if (interface->dev.driver) { if ((ret = checkintf(ps, ret)))
if ((ret = checkintf(ps, ret))) return ret;
return ret;
}
if (usb_set_interface(ps->dev, setintf.interface, setintf.altsetting)) if (usb_set_interface(ps->dev, setintf.interface, setintf.altsetting))
return -EINVAL; return -EINVAL;
return 0; return 0;
......
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