Hi,
the serial subdrivers may be unloading while we open.
This patch against 2.5 guards against that.
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], 2002-11-27 22:39:32+01:00, [EMAIL PROTECTED]
- kill module unload race
usb-serial.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff -Nru a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
--- a/drivers/usb/serial/usb-serial.c Wed Nov 27 22:40:21 2002
+++ b/drivers/usb/serial/usb-serial.c Wed Nov 27 22:40:21 2002
@@ -467,9 +467,13 @@
down (&port->sem);
port->tty = tty;
- /* lock this module before we call it */
+ /* lock this module before we call it,
+ this may, which means we must bail out, safe because we are called with BKL
+held */
if (serial->type->owner)
- __MOD_INC_USE_COUNT(serial->type->owner);
+ if (!try_module_get(serial->type->owner)) {
+ retval = -ENODEV;
+ goto bailout;
+ }
++port->open_count;
if (port->open_count == 1) {
@@ -485,6 +489,7 @@
__MOD_DEC_USE_COUNT(serial->type->owner);
}
}
+bailout:
up (&port->sem);
return retval;
===================================================================
This BitKeeper patch contains the following changesets:
1.962
## Wrapped with gzip_uu ##
begin 664 bkpatch11670
M'XL(`,4[Y3T``ZU4VT[<,!!]CK]B*EZX9>-+[M4B"HO:"E00%7U%3N)-HLW&
ME>VP737]]SH;"JU*@;8DD>+,V&?.\9QX"ZZT4*DCF_I&*+0%[Z0V]E.TLA63
M2BY%4[?=EXE4I4U>2FF3WA#VQA5>MG"-$D)[%H8&R$ZZX":OP.9TZI`)NXN8
M]6>1.I<G;Z_.WEPB-)W"<<7;4GP4!J93E"T.BTXTDX62O!KJ]7?IGF),"*$!
M9D%(@I[&C/D]"7%6V&%!HV2>A0D:&1T^Q/U7+&JQ(H(#G\4]"RG#:`9DDH04
M,/4(\6@$E*8L21G=PR3%&!Z!ACT"+D9'\/\"CE$.+BSJIH&E++I&0-<VDA>@
M>"[0*;`H)#ZZN-\WY/[EA1#F&!T\P+50@T+M=3H;6EGS9AB.HTE^+\#'"8E[
MXL>4]D4R]T48,YKY6<$P>6R;_E#`_;G"IB^4L(3A/B`!"3<N>6+AP]YY"3FH
M5*(\'#%SN7RN`FLH>R>]CW$2;IP5_6XL_!QC1>#2%S362L"RT\::*I=M49M:
MMKQIUE"WN1)<"S"5=9SFI8!<=JVQCAN[<`ZN6FT>ZZ"+IQKR#Z:<^1$&@MX/
M+XH<;Q<:F2\LGUK_^!,R,9=*#!IR2QIJLX\<@-LI?+T/JZJVA\Q2\%;?*<UX
MW8#LS#YH/A\P<M[I#0A7(Y`H8%6;"HY.SZ`230&[WL"&CFPH^,AQZCELOS)J
M?3U2N2Z%V1[%N@?#H>8>R%4KU,X.?+6S'27,#6]@"N[)A_/9R:?70["41F[H
F6#9#X)N%CR-;Y3:6WI^<>27RA>Z6TRR(66([B;X#.-(!O*4%````
`
end
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel