]> git.baikalelectronics.ru Git - kernel.git/commit
stmmac: fix resource management when resume
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>
Fri, 4 Dec 2015 06:21:06 +0000 (07:21 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 5 Dec 2015 22:49:11 +0000 (17:49 -0500)
commite902dd94ac759b6662541276bdab129798aaf3df
tree61d4a0322654b612d11a9ea0d39b20820ee1090a
parentfdd790917e86150695d89c72d28905ddb6694392
stmmac: fix resource management when resume

There is a memleak when suspend/resume this driver version.
Currently the stmmac, during resume step, reallocates all the resources
but they are not released when suspend.
The patch is not to release these resources but the logic has been changed.
In fact, it is not necessary to free and reallocate all from scratch
because the memory data will be always preserved.
As final solution, the patch just reinit the descriptors and the rx/tx
pointers only when resume. Tested done on STi boxes.

Reported-by: ZhengShunQian <zhengsq@rock-chips.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c