net: ethernet: mtk-star-emac: fix wrong unmap in RX handling
authorBiao Huang <biao.huang@mediatek.com>
Tue, 2 Mar 2021 03:33:23 +0000 (11:33 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Mar 2021 23:28:07 +0000 (15:28 -0800)
commit95b39f07a17faef3a9b225248ba449b976e529c8
tree59b213d1b4fdafa3426ed56e1fcfe12aeab58656
parentfa706dce2f2d7012654e2eab40da2b526c1424b3
net: ethernet: mtk-star-emac: fix wrong unmap in RX handling

mtk_star_dma_unmap_rx() should unmap the dma_addr of old skb rather than
that of new skb.
Assign new_dma_addr to desc_data.dma_addr after all handling of old skb
ends to avoid unexpected receive side error.

Fixes: f96e9641e92b ("net: ethernet: mtk-star-emac: fix error path in RX handling")
Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_star_emac.c