mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
iw_cxgb4: correctly enforce the max reg_mr depth
commit7b72717a20upstream. 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:8376b86de7("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
33beaca902
commit
f47f1f9767
@@ -720,7 +720,7 @@ static int c4iw_set_page(struct ib_mr *ibmr, u64 addr)
|
||||
{
|
||||
struct c4iw_mr *mhp = to_c4iw_mr(ibmr);
|
||||
|
||||
if (unlikely(mhp->mpl_len == mhp->max_mpl_len))
|
||||
if (unlikely(mhp->mpl_len == mhp->attr.pbl_size))
|
||||
return -ENOMEM;
|
||||
|
||||
mhp->mpl[mhp->mpl_len++] = addr;
|
||||
|
||||
Reference in New Issue
Block a user