]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/irdma: Check return value from ib_umem_find_best_pgsz
authorShiraz Saleem <shiraz.saleem@intel.com>
Tue, 22 Jun 2021 17:52:31 +0000 (12:52 -0500)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 22 Jun 2021 18:25:47 +0000 (15:25 -0300)
commit6148431b15f1e35e02f18d857227675dc1909af5
treebbee4c6e9643451278888ca90adf0204afaba1b6
parentfe698aa0194b1ffaeac4e85266a57cee8373df25
RDMA/irdma: Check return value from ib_umem_find_best_pgsz

iwmr->page_size stores the return from ib_umem_find_best_pgsz and maybe
zero when used in ib_umem_num_dma_blocks thus causing a divide by zero
error.

Fix this by erroring out of irdma_reg_user when 0 is returned from
ib_umem_find_best_pgsz.

Link: https://lore.kernel.org/r/20210622175232.439-3-tatyana.e.nikolova@intel.com
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1505149 ("Integer handling issues")
Fixes: 434ed3ceee5a ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/irdma/verbs.c