[Description]

Change code for memory free which may cause memory leak
-- memory leak occurs when user use DRAM for DMAD
   -- SRAM ==1, no need free ring->dma
   -- SRAM ==0, DMAD memory should be freed in mtk_rx_clean

[Release-log]
N/A

Change-Id: I599d3e38c66d67c0e9bfd7afc3e8f773258f97db
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6182630
This commit is contained in:
developer 2022-06-30 13:31:47 +08:00 committed by hanwckf
parent 9c0d04cab0
commit 2a758ab185

View File

@ -2472,7 +2472,7 @@ static void mtk_dma_free(struct mtk_eth *eth)
eth->phy_scratch_ring = 0;
}
mtk_tx_clean(eth);
mtk_rx_clean(eth, &eth->rx_ring[0],1);
mtk_rx_clean(eth, &eth->rx_ring[0],eth->soc->has_sram);
mtk_rx_clean(eth, &eth->rx_ring_qdma,0);
if (eth->hwlro) {