Hi,
in usb.c during disconnect handling a reference to a driver is passed
after the module usage count is decremented. In theory this is a race.
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-05-04 23:54:59+02:00, [EMAIL PROTECTED]
fix small race
diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.c Sat May 4 23:55:40 2002
+++ b/drivers/usb/core/usb.c Sat May 4 23:55:40 2002
@@ -81,7 +81,7 @@
i, driver->name);
return -EINVAL;
}
-
+
for (i = start_minor; i < (start_minor + num_minors); ++i)
usb_minors[i] = driver;
@@ -114,7 +114,7 @@
int usb_register(struct usb_driver *new_driver)
{
int retval = 0;
-
+
if ((new_driver->fops) && (new_driver->num_minors == 0)) {
err ("%s driver must specify num_minors", new_driver->name);
return -EINVAL;
@@ -178,7 +178,7 @@
if (new_driver->fops == NULL)
goto exit;
- *start_minor = 0;
+ *start_minor = 0;
spin_lock (&minor_lock);
for (i = 0; i < MAX_USB_MINORS; ++i) {
if (usb_minors[i])
@@ -1899,11 +1899,12 @@
down(&driver->serialize);
driver->disconnect(dev, interface->private_data);
up(&driver->serialize);
- if (driver->owner)
- __MOD_DEC_USE_COUNT(driver->owner);
/* if driver->disconnect didn't release the interface
*/
if (interface->driver)
usb_driver_release_interface(driver,
interface);
+ /* we don't need the driver any longer */
+ if (driver->owner)
+ __MOD_DEC_USE_COUNT(driver->owner);
}
/* remove our device node for this interface */
put_device(&interface->dev);
===================================================================
This BitKeeper patch contains the following changesets:
1.518
## Wrapped with gzip_uu ##
begin 664 bkpatch8136
M'XL(`-Q8U#P``ZU46V^;,!1^CG_%D?JPK57`-IA`JE39DJB;=FG5+F^3(C`G
M@87@R89>)G[\#$B-6F75ULT"S+GRG<^?.(*E03T>J"*_04V.X+TRE36Q5"4Z
MF=IAD9?UG:/TQ@:OE+)!MW6[?86;;(>51C1NBC=K0VS295S)#&S,C`?,\1X\
MU?T/'`^N%N?+3V^O")E,8);%Y0:OL8+)A"3;:5ICX6RUBK/V>\U#N.&4,L:X
MH)X(F&AXZ'E^PP*:I/8UY:-HG001N5'?*Y39U-0&'?GS<3VGMIJ%/!"T8=$H
MBL@<F"-8")2[5+C4!^Z-A3\6T0GE8TJA'W!ZB`HX83"DY!W\.^@9D;#.[\#L
MXJ(`'4LD'X$S-F+D<D\0&?[E(H3&E)P=`)CJ=BSCUB9I;T?N@?HT8D'#/5_X
MC0PXH@@Y&\DD]JAXCHY'/:72N&_<TNYS)OQV=NX+UAW\X?S#*G@A7K+1N)GV
M;:3:/0O1]R@->&`ATC`:^9TR0OY4&)[_)\((8"C^FS"J#&>KI`J$V\09"J
M+BLPF:J+%!*$%*7&V&`*\;I"#1H+:^;EIBO-2^M;]Y+JR;^`H;[M+BN1R]^<
MPPO$-@]]8.1#]_Q&YE:^K=EOK1VRSNZVP;&I8EVM=GFI-$R`GMJ$B'[EMAIL PROTECTED]
M`7AD8)=[#+=V0%6^JJ!$.V$[40\8XO(>"F7IU'#L=MGY&E[WP>&9NBU1O^G<
M@]7J\\5\-5_,5LOKQ6IVL?SR]4G>Z?Z?)3.46U/O)FG$A(@#3GX!'<3)\1\%
"````
`
end
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel