[#6641] ifconfig only frees the first page of tx_desc
Submitted By: Regis DARGENT
Open Fixed In Release:
Found In Release:
ALL Silicon Revision:
Is this bug repeatable?:
Uboot version or rev.:
Toolchain version or rev.:
App binary format:
Summary: ifconfig only frees the first page of tx_desc
When you call ifconfig <eth interface> down, only the first allocated page of the tx_desc is freed, causing memory leak.
In fact, bfin_mac_free (when CONFIG_BFIN_MAC_USE_L1 not defined), uses sizeof(ptr) to determine the number of bytes to be deallocated, which only reports the size of the first element in the case of a table. Therefore, only the page(s) corresponding to the size of one element are freed. In the case of a 10 elements table, each of size 1596 bytes, only the first 4kB page is freed instead of the 16kB allocated.
How to reproduce the bug:
a simple loop may do it:
ifconfig eth0 up (with a valid IP)
wait for the interface to come up (eg 5sec)
ifconfig eth0 down
wait for the interface to come down (eg 5sec)
a proposed patch is attached.
--- Sonic Zhang 2011-06-15 05:55:14
Thanks for the bug report. I commit a more unified patch other than put macro
around each free line.
File Name File Type File Size Posted By
bfin_mac.c application/c 47023 Regis DARGENT