]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/mlx5: Fix returned type from _mlx5r_umr_zap_mkey()
authorLeon Romanovsky <leonro@nvidia.com>
Sun, 20 Jul 2025 09:25:34 +0000 (12:25 +0300)
committerLeon Romanovsky <leon@kernel.org>
Mon, 21 Jul 2025 06:27:40 +0000 (02:27 -0400)
commitd59ebb4549ff9bdba7abf6a5246a749e7f4a36ed
treeb929f792cf46a86a1eef590c3e7e27b7505473f1
parentaee80e6ffc5878a90ca5c16760b2c4f3f3d7343f
RDMA/mlx5: Fix returned type from _mlx5r_umr_zap_mkey()

As Colin reported:
 "The variable zapped_blocks is a size_t type and is being assigned a int
  return value from the call to _mlx5r_umr_zap_mkey. Since zapped_blocks is an
  unsigned type, the error check for zapped_blocks < 0 will never be true."

So separate return error and nblocks assignment.

Fixes: e73242aa14d2 ("RDMA/mlx5: Optimize DMABUF mkey page size")
Reported-by: Colin King (gmail) <colin.i.king@gmail.com>
Closes: https://lore.kernel.org/all/79166fb1-3b73-4d37-af02-a17b22eb8e64@gmail.com
Link: https://patch.msgid.link/71d8ea208ac7eaa4438af683b9afaed78625e419.1753003467.git.leon@kernel.org
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
drivers/infiniband/hw/mlx5/umr.c