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:39:31 +0000 (11:39 +0200)
commitf47f1f976745a9dc9f77c36018a5ff278207be5b
treeec780b863270a73e240f7d90a8d74f3f202752c1
parent33beaca902a67b425cd0fc0fe2ba41cb9e1a0aaf
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