mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
RDMA/mlx5: Check reg_create() create for errors
The reg_create() can fail. Check for errors before dereferencing it.
Fixes: dd1b913fb0 ("RDMA/mlx5: Cache all user cacheable mkeys on dereg MR flow")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/Y+ERYy4wN0LsKsm+@kili
Reviewed-by: Devesh Sharma <devesh.s.sharma@oracle.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
committed by
Leon Romanovsky
parent
68e416255b
commit
8e6e49ccf1
@@ -1166,6 +1166,8 @@ static struct mlx5_ib_mr *alloc_cacheable_mr(struct ib_pd *pd,
|
||||
mutex_lock(&dev->slow_path_mutex);
|
||||
mr = reg_create(pd, umem, iova, access_flags, page_size, false);
|
||||
mutex_unlock(&dev->slow_path_mutex);
|
||||
if (IS_ERR(mr))
|
||||
return mr;
|
||||
mr->mmkey.rb_key = rb_key;
|
||||
return mr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user