dahdi-linux/include/dahdi
Shaun Ruffell 761e02da52 dahdi: Protect echocan creation/destruction with mutex.
This closes a reference and memory leak when multiple CPUs are enabling echocan
on a single channel in parallel.

The essential problem is that the call to try_module_get() is not serialized.
Two separate threads can come into ioctl_echocan() on the same channel, they
coordinate via the dahdi_chan.lock to release any current echocan, but then both
create a new echocan state, bump the reference on the module, and the last one
through will actually attach the new state to the channel. The earlier reference
/ memory is leaked.

I tried to conceive of a way to fix this leak without adding a new lock, but the
choices where calling throught the function pointers with dahdi_chan.lock.
Otherwise I needed to change the semantics of echocan_create /free which would
ripple through the hardware echocan modules.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-20 13:01:27 -05:00
..
dahdi_config.h dahdi_config: Remove unused NO_DCDC definition. 2013-11-11 14:39:18 -06:00
fasthdlc.h wct4xxp: Moving the transmit short detection behind debug module param. 2010-08-27 21:59:27 +00:00
Kbuild wct4xxp: Moving the transmit short detection behind debug module param. 2010-08-27 21:59:27 +00:00
kernel.h dahdi: Protect echocan creation/destruction with mutex. 2014-06-20 13:01:27 -05:00
user.h dahdi: Restore DAHDI_CONFLINK functionality as compile time option. 2013-03-07 16:19:05 -06:00
wctdm_user.h wct4xxp: Moving the transmit short detection behind debug module param. 2010-08-27 21:59:27 +00:00