RDMA/rxe: Return the correct errno
authorZhu Yanjun <yanjun.zhu@linux.dev>
Mon, 8 Apr 2024 14:21:42 +0000 (16:21 +0200)
committerLeon Romanovsky <leon@kernel.org>
Thu, 11 Apr 2024 11:47:26 +0000 (14:47 +0300)
commitdfcdb38b21e4fb92a49acdbdf6afa82c07c8eba0
tree91c261e8f17b72601f78e32b82d10af94e1b70c6
parentc8fc935f4b198dc6e9871b29f4f3360631d90c8e
RDMA/rxe: Return the correct errno

In the function __rxe_add_to_pool, the function xa_alloc_cyclic is
called. The return value of the function xa_alloc_cyclic is as below:
"
 Return: 0 if the allocation succeeded without wrapping.  1 if the
 allocation succeeded after wrapping, -ENOMEM if memory could not be
 allocated or -EBUSY if there are no free entries in @limit.
"
But now the function __rxe_add_to_pool only returns -EINVAL. All the
returned error value should be returned to the caller.

Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Link: https://lore.kernel.org/r/20240408142142.792413-1-yanjun.zhu@linux.dev
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/sw/rxe/rxe_pool.c