]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/rtrs: Fix clt_path::max_pages_per_mr calculation
authorHonggang LI <honggangli@163.com>
Mon, 29 Dec 2025 02:56:17 +0000 (10:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:37 +0000 (10:14 +0100)
commitff552378e80df3888c8b0a871f4cae75c57bb944
treedc870cf2217579eb0116573d0946fe54065b02b9
parent676907004256e0226c7ed3691db9f431404ca258
RDMA/rtrs: Fix clt_path::max_pages_per_mr calculation

[ Upstream commit 43bd09d5b750f700499ae8ec45fd41a4c48673e6 ]

If device max_mr_size bits in the range [mr_page_shift+31:mr_page_shift]
are zero, the `min3` function will set clt_path::max_pages_per_mr to
zero.

`alloc_path_reqs` will pass zero, which is invalid, as the third parameter
to `ib_alloc_mr`.

Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality")
Signed-off-by: Honggang LI <honggangli@163.com>
Link: https://patch.msgid.link/20251229025617.13241-1-honggangli@163.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/ulp/rtrs/rtrs-clt.c