Hi,

usb_set_infdata must be done before open might use the data.

        Regards
                Oliver

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


[EMAIL PROTECTED], 2003-07-09 00:35:15+02:00, [EMAIL PROTECTED]
  - fix probe vs. open race


 scanner.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)


diff -Nru a/drivers/usb/image/scanner.c b/drivers/usb/image/scanner.c
--- a/drivers/usb/image/scanner.c       Wed Jul  9 00:37:56 2003
+++ b/drivers/usb/image/scanner.c       Wed Jul  9 00:37:56 2003
@@ -479,7 +479,7 @@
 
        dev = scn->scn_dev;
 
-       down(&(scn->sem));      /* Now protect the scn_usb_data structure */ 
+       down(&(scn->sem));      /* Now protect the scn_usb_data structure */
 
        up(&scn_mutex); /* Now handled by the above */
 
@@ -942,7 +942,7 @@
        }
 
        interface = intf->altsetting;
- 
+
        if (interface[0].desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC &&
            interface[0].desc.bInterfaceClass != USB_CLASS_PER_INTERFACE &&
            interface[0].desc.bInterfaceClass != SCN_CLASS_SCANJET) {
@@ -1015,7 +1015,7 @@
  * with it.  The problem with this is that we are counting on the fact
  * that the user will sequentially add device nodes for the scanner
  * devices.  */
-       
+
        down(&scn_mutex);
 
        retval = usb_register_dev(intf, &scanner_class);
@@ -1082,7 +1082,7 @@
                return -ENOMEM;
        }
        dbg("probe_scanner(%d): ibuf address:%p", intf->minor, scn->ibuf);
-       
+
 
        switch (dev->descriptor.idVendor) { /* Scanner specific read timeout 
parameters */
        case 0x04b8:            /* Seiko/Epson */
@@ -1117,9 +1117,8 @@
        info ("USB scanner device (0x%04x/0x%04x) now attached to %s",
              dev->descriptor.idVendor, dev->descriptor.idProduct, name);
 
-       up(&scn_mutex);
-
        usb_set_intfdata(intf, scn);
+       up(&scn_mutex);
 
        return 0;
 }

===================================================================


This BitKeeper patch contains the following changesets:
1.2083
## Wrapped with gzip_uu ##


begin 664 bkpatch15420
M'XL(`,5'"S\``[U4;6O;,!#^'/[EMAIL PROTECTED]"[9/DF7++BG=FK&-C:UDZ[=!L>5K
M4E+;0;;;#OSC)\=;[EMAIL PROTECTED]@A-WNN<>W3UH!\X;LNFDOKZZ(<MVX%W=M.G$
MG<NNH,JOJ%MUI5_;[EMAIL PROTECTED]>X)7S%WYRQKS1)<J$DG
MW)?WGO;[FM+)_,W;\X^OYHQ-IW"ZS*H%?:$6IE.6KTZ*CJ[]E:VSY5"NOP_W
M`I%S+A1*%7'5"RUEV/,(\\(="Q$GEWF4L(6EQ<F8;NKR8;K$&&,>J3C4O5(J
MD6P&W!>H):`,,`XP`<14JI2K0Q0I(HSO.WFB$7#(P4/V&[EMAIL PROTECTED]
MMLX);AH?ZC558#-#[`.H2,<1.]NVBGE_N1C##-GQ$UP+.SQP,[N@,5E5D?7-
MEG>("8_Z2'*-O0BE413I/`]C*?+DF>[EMAIL PROTECTED]"A,'&^MP(X5G
MDIX6QPO(/Q;*;PE'#BR63CX.:AC'(!T=/Q8.)G\@'`5>]%^$,[;V,WCV=K.=
M$,Z>Z_(_Z&H6:@&<O1_-I*AOJ[W=O<[EMAIL PROTECTED]<"P)=-"NR1P
MX0M7_J+([EMAIL PROTECTED]:UG:F[2S!0<!F2:@&N-%\8S..7`^.GW;CT6KTZ%]WN$`0SL/%
FAD2WWML=2I1=2W?[1]O_R"S)K)JNG"*9(BP*8C\`T_CPSOD$````
`
end



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to