mbox series

[0/2] infiniband: Fxi dma_map_sg error check

Message ID 20220826095615.74328-1-jinpu.wang@ionos.com (mailing list archive)
Headers show
Series infiniband: Fxi dma_map_sg error check | expand

Message

Jinpu Wang Aug. 26, 2022, 9:56 a.m. UTC
Hi, all,

While working on a bugfix on RTRS[1], I noticed there are quite a few other
drivers have the same problem, due to the fact dma_map_sg return 0 on error,
not like most of the cases, return negative value for error.

I "grep -A 5 dma_map_sg' in kernel tree, and audit/fix the one I feel is buggy,
hence this patchset. As suggested by Christoph Hellwig, I now send the patches per
subsystem, this is for infiniband subsystem.

The first one for mthca, leon mentioned it's too old to change, I still keep it
in the hope others have a different opinion.

The second patch change the return value follow the patch from Christoph
Hellwig, we might want to change the type for in the drivers which calls
dma_map_sg or ib_dma_map_sg to unsigned int to.

Thanks!

[1] https://lore.kernel.org/linux-rdma/20220818105355.110344-1-haris.iqbal@ionos.com/T/#t
Jack Wang (2):
  infiniband/mthca: Fix dma_map_sg error check
  RDMA: dma-mapping: Return an unsigned int from ib_dma_map_sg{,_attrs}

 drivers/infiniband/core/device.c            | 2 +-
 drivers/infiniband/hw/mthca/mthca_memfree.c | 7 ++++---
 include/rdma/ib_verbs.h                     | 6 +++---
 3 files changed, 8 insertions(+), 7 deletions(-)