mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
net: hns3: fix a bug when alloc new buffer
[ Upstream commitb9077428ec] 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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
122e18d27d
commit
669ff2a9aa
@@ -1586,7 +1586,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user