cxgbe/iw_cxgbe: correctly enforce the max reg_mr depth.

Reported by:	Andrew Zhu @ Netapp
Obtained from:	Chelsio Communications
MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2020-02-18 20:43:10 +00:00
parent fbb890056e
commit 9a4a1be02c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358082

View File

@ -682,7 +682,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;