iw_cxgb4: correctly enforce the max reg_mr depth
authorSteve Wise <swise@opengridcomputing.com>
Thu, 21 Jun 2018 14:43:21 +0000 (07:43 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 25 Jun 2018 21:27:51 +0000 (15:27 -0600)
commit7b72717a20bba8bdd01b14c0460be7d15061cd6b
tree98ce3e993f8f142d4263c4149da31a39d4f9a569
parent6f0d349d922ba44e4348a17a78ea51b7135965b1
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>
drivers/infiniband/hw/cxgb4/mem.c