Re: [Ndiswrapper-general] Massive Memory Leak
Status: Beta
Brought to you by:
pgiri
From: Giridhar P. <gi...@lm...> - 2005-02-26 18:42:12
|
Again, if you sent me the mail privately, I certainly would've ignored it. But since you have been airing it in the public, I need to justify why I have been saying that your patch and explanations are broken, lest I create the impression that my comments are unjust. If you have paid a bit more attention to your patch and my explanations, you would have realized the futility of being adamant about your patch. Let me deconstruct it for you. Your patch (against 1.0) still leaks memory. As I have been saying, 64-bit driver for Broadcom allocates MDL (which is same as NDIS_BUFFER) with NdisAllocateBuffer but frees with IoFreeMdl. In NdisAllocateBuffer, you put a newly allocated NDIS_BUFFER in a list of allocated buffers. Then _if_ NdisFreeBuffer is called, you free it from the list and kfree it. But this driver never calls NdisFreeBuffer. Fortunately, this driver uses the same virtual addresses again to allocate another MDL. This is not necessarily the case with every driver and it is not correct assume so. This is what I have been saying as broken explanation - just because it works for you doesn't mean it is correct or will work for all drivers. If you decide to continue to use your patch, at least free the buffers in IoFreeMdl (make sure you treat MDL passed as NDIS_BUFFER differently from plain MDL). Alternately, if you don't care that you may have long list of allocated but unused MDLs, at least free them all in NdisFreeBufferPool. If you do neither, you are leaking memory even with the patch, albeit not as much in vanilla 1.0. -- Giri |