lkml.org 
[lkml]   [2017]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.14 092/135] net: hns3: fix a bug when alloc new buffer
    Date
    From: Lipeng <lipeng321@huawei.com>

    [ Upstream commit b9077428ec5569aacb2952d8a2ffb51c8988d3c2 ]

    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>
    ---
    drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
    index ea121b0b16ac..186772493711 100644
    --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
    +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
    @@ -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);
    }
    --
    2.11.0
    \
     
     \ /
      Last update: 2017-12-07 18:58    [W:4.098 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site