Dear Hinko:
Thanks all the same for your
help.
The
question was resoved.Look at the source code in the usb disconnect
function:
acm->dev =
NULL;
... acm_write_buffers_free(acm);
...
Because
acm_write_buffers_free() will do nothing when acm->dev or acm is NULL, the
code above will cause memory leak.
I move "acm->dev = NULL;" after the
"acm_write_buffers_free(acm);" ,and the problem is resoved.
2008-10-21
snoppy1314
发件人: Hinko Kocevar
发送时间: 2008-10-17 18:12:54
收件人: snoppy1314
抄送: kernelnewbies
主题: Re: memory leak about
cdc-acm driver
snoppy1314 wrote:
> Hi,Everybody,
>
> These days, I find a problem:after insmod the cdc-acm driver, everytime I connect and then disconnect the acm device to usb bus, Linux will lose 64kB memory.I use the 2.6.26 kernel,and didn't modify the cdc-acm driver.
>
> who has met this problem? Or may you tell me how to resolve it.
>
>
Enable slab/slub debugging in kernel config and look at the /proc/sl[ua]bdebug (me thinks) - otherwise look at the kernel docs for memory debugging
HTH,
Hinko
--
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar@xxxxxxxxxxxx
Http: www.cetrtapot.si
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ |