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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jul 2018 09:37:53 +0000 (11:37 +0200)
commit70c89bccb516af8694c50ba73b553278d7afaed4
tree0a1583a24e4cff6fa3efa1ef78f286cd41d26b0c
parente78e3706bfba8b7865b7a52b3d1f4643e31c2197
iw_cxgb4: correctly enforce the max reg_mr depth

commit 7b72717a20bba8bdd01b14c0460be7d15061cd6b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/cxgb4/mem.c