lkml.org 
[lkml]   [2018]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.14 38/67] IB/umem: Fix use of npages/nmap fields
    Date
    From: Artemy Kovalyov <artemyko@mellanox.com>

    [ Upstream commit edf1a84fe37c51290e2c88154ecaf48dadff3d27 ]

    In ib_umem structure npages holds original number of sg entries, while
    nmap is number of DMA blocks returned by dma_map_sg.

    Fixes: c5d76f130b28 ('IB/core: Add umem function to read data from user-space')
    Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    ---
    drivers/infiniband/core/umem.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
    index 130606c3b07c..9a4e899d94b3 100644
    --- a/drivers/infiniband/core/umem.c
    +++ b/drivers/infiniband/core/umem.c
    @@ -352,7 +352,7 @@ int ib_umem_copy_from(void *dst, struct ib_umem *umem, size_t offset,
    return -EINVAL;
    }

    - ret = sg_pcopy_to_buffer(umem->sg_head.sgl, umem->nmap, dst, length,
    + ret = sg_pcopy_to_buffer(umem->sg_head.sgl, umem->npages, dst, length,
    offset + ib_umem_offset(umem));

    if (ret < 0)
    --
    2.14.1
    \
     
     \ /
      Last update: 2018-03-08 07:43    [W:2.513 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site