Hi,

this is a very unusual race where dropping the BKL in a multithreaded
application using poll can lead to a memory leak. The BKL really is strange
at times.

        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-07-10 18:04:20+02:00, [EMAIL PROTECTED]
  - fix race leading to memory leak




diff -Nru a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
--- a/drivers/usb/core/devices.c        Wed Jul 10 18:05:45 2002
+++ b/drivers/usb/core/devices.c        Wed Jul 10 18:05:45 2002
@@ -597,6 +597,13 @@
                        unlock_kernel();
                        return POLLIN;
                }
+               
+               /* we may have dropped BKL - need to check for having lost the race */
+               if (file->private_data) {
+                       kfree(st);
+                       goto lost_race;
+               }
+
                /*
                 * need to prevent the module from being unloaded, since
                 * proc_unregister does not call the release method and
@@ -606,6 +613,7 @@
                file->private_data = st;
                mask = POLLIN;
        }
+lost_race:
        if (file->f_mode & FMODE_READ)
                 poll_wait(file, &deviceconndiscwq, wait);
        if (st->lastev != conndiscevcnt)

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


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


begin 664 bkpatch11728
M'XL(`%E;+#T``ZU474_;,!1]KG_%E7CA8VEL)W8^IB(&0QL":8B)MTG(36Z:
MJ&E<.6D+6O;?9Z<;%1)C&LSR@WVO[_$YUT?>@]L633K2=;5&0_;@LVX[N\5&
M-S@N]0+KJEG=C[69V>2-UC;IN["_K?"G<Z\SB*V_X8+8(]>JRTJPF38=L7'P
M&.D>EIB.;LX_W5Y]N"%D,H&S4C4S_(H=3"9D.C_)5UB/YT:KTMW6/Z9[3BEC
MC`L:",E$S^,@"'LFZ32WRYQ'23&5"=GR.7F.^5,L3B-&F0@2BR4$DX)\!#:6
M4@+E/HU\1H'%*0U33H\H3RF%%Z#AB(%'R2F\7<`9R<"#HKH'HS*$&E5>-3/H
M-"QPH<V#B\S))0@I@I!<[_I'O'\<A%!%R?$SG'/CE+;^JIWZ.:ZK#-MQMN,?
MTH3)GO.(LU[%(N:1$+%0=!H7R4M=>H*;:8-/P;<O(FG(:2^X8.'@CS_7/&^8
M-W`G,X.SDRU4IA=_I2M91`4+:-*'5,318"`6O,X_\?_U3U7`Z>455*WMGUXN
M,7\'78E@L$"#C?65]9,+_/*46W:EL5ZSU0";JFD&T[D2Y\)2M:#J6F>JP]RA
MUO9_<"8<GND+>&8S3&NJZQ=>[!46O1!)`A$9C>ST#V%C*:L'RV>-OY4-0CUH
MT"ZMJJS$;`Z%-NZ0$^&H[I0<^A;(=F>_J&KTCI>6J]5TEZM.'<!WFQO-"_N1
M[;?=P7NWFVF+Z2#N7+D+_2#?R(6D,3#R&$]W?]YP?[M:3)(BDU&4(?D)X;T*
%95T%````
`
end



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Two, two, TWO treats in one.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to