summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2018-06-21 10:43:21 -0400
committerJason Gunthorpe <jgg@mellanox.com>2018-06-25 17:27:51 -0400
commit7b72717a20bba8bdd01b14c0460be7d15061cd6b (patch)
tree98ce3e993f8f142d4263c4149da31a39d4f9a569 /drivers/infiniband
parent6f0d349d922ba44e4348a17a78ea51b7135965b1 (diff)
iw_cxgb4: correctly enforce the max reg_mr depth
The code was mistakenly using the length of the page array memory instead of the depth of the page array. This would cause MR creation to fail in some cases. Fixes: 8376b86de7d3 ("iw_cxgb4: Support the new memory registration API") Cc: stable@vger.kernel.org Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/cxgb4/mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
index 1445918e3239..7b76e6f81aeb 100644
--- a/drivers/infiniband/hw/cxgb4/mem.c
+++ b/drivers/infiniband/hw/cxgb4/mem.c
@@ -774,7 +774,7 @@ static int c4iw_set_page(struct ib_mr *ibmr, u64 addr)
774{ 774{
775 struct c4iw_mr *mhp = to_c4iw_mr(ibmr); 775 struct c4iw_mr *mhp = to_c4iw_mr(ibmr);
776 776
777 if (unlikely(mhp->mpl_len == mhp->max_mpl_len)) 777 if (unlikely(mhp->mpl_len == mhp->attr.pbl_size))
778 return -ENOMEM; 778 return -ENOMEM;
779 779
780 mhp->mpl[mhp->mpl_len++] = addr; 780 mhp->mpl[mhp->mpl_len++] = addr;