Skip to content
Commit ac0fffa0 authored by Logan Gunthorpe's avatar Logan Gunthorpe Committed by Jason Gunthorpe
Browse files

RDMA/core: Set sgtable nents when using ib_dma_virt_map_sg()

ib_dma_map_sgtable_attrs() should be mapping the sgls and setting nents
but the ib_uses_virt_dma() path falls back to ib_dma_virt_map_sg() which
will not set the nents in the sgtable.

Check the return value (per the map_sg calling convention) and set
sgt->nents appropriately on success.

Fixes: 79fbd3e1 ("RDMA: Use the sg_table directly and remove the opencoded version from umem")
Link: https://lore.kernel.org/r/20211013165942.89806-1-logang@deltatee.com


Reported-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Tested-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 3b87e082
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment