mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-29 22:14:41 +08:00
net: hns3: fix a bug when alloc new buffer
When alloce new buffer to HW, should unmap the old buffer first.
This old code map the old buffer but not unmap the old buffer,
this patch fixes it.
Fixes: 76ad4f0
(net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC)
Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5908064a0b
commit
b9077428ec
@ -1595,7 +1595,7 @@ out_buffer_fail:
|
||||
static void hns3_replace_buffer(struct hns3_enet_ring *ring, int i,
|
||||
struct hns3_desc_cb *res_cb)
|
||||
{
|
||||
hns3_map_buffer(ring, &ring->desc_cb[i]);
|
||||
hns3_unmap_buffer(ring, &ring->desc_cb[i]);
|
||||
ring->desc_cb[i] = *res_cb;
|
||||
ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user