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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:06:14 +0000 (17:06 +0100)
commitfa0bc09db49bf4875d9a8c88813fe2b87c1059bb
tree25ed531be59f45a9df5564830873c916eae3e2de
parent1cdd008902d4e32f270e8fdb3239db6412f0a90b
net: ethernet: mtk-star-emac: fix wrong unmap in RX handling

commit 95b39f07a17faef3a9b225248ba449b976e529c8 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mediatek/mtk_star_emac.c