* [PATCH 9/9] USB usbfs: drop pointless racy check
@ 2004-04-14 10:51 Duncan Sands
0 siblings, 0 replies; only message in thread
From: Duncan Sands @ 2004-04-14 10:51 UTC (permalink / raw)
To: Greg KH; +Cc: linux-usb-devel, linux-kernel, Frederic Detienne
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(-)
diff -Nru a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
--- a/drivers/usb/core/devio.c Wed Apr 14 12:18:37 2004
+++ b/drivers/usb/core/devio.c Wed Apr 14 12:18:37 2004
@@ -747,10 +747,8 @@
if ((ret = findintfif(ps->dev, setintf.interface)) < 0)
return ret;
interface = ps->dev->actconfig->interface[ret];
- if (interface->dev.driver) {
- if ((ret = checkintf(ps, ret)))
- return ret;
- }
+ if ((ret = checkintf(ps, ret)))
+ return ret;
if (usb_set_interface(ps->dev, setintf.interface, setintf.altsetting))
return -EINVAL;
return 0;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-04-14 10:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-14 10:51 [PATCH 9/9] USB usbfs: drop pointless racy check Duncan Sands
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®