]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/rxe: fix xa_alloc_cycle() error return value check again
authorDongliang Mu <mudongliangabcd@gmail.com>
Thu, 9 Jun 2022 07:06:56 +0000 (15:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:41:37 +0000 (14:41 +0200)
commit39ea8206a51ca0eedc62b893a58507f8e533ae8b
treefaa64a3bf7cbba1708249d654dfc593f78dfc0a5
parent5144b80fd163d8887f337b29f6cdde3f5c287ee6
RDMA/rxe: fix xa_alloc_cycle() error return value check again

[ Upstream commit 1a685940e6200e9def6e34bbaa19dd31dc5aeaf8 ]

Currently rxe_alloc checks ret to indicate error, but 1 is also a valid
return and just indicates that the allocation succeeded with a wrap.

Fix this by modifying the check to be < 0.

Link: https://lore.kernel.org/r/20220609070656.1446121-1-dzm91@hust.edu.cn
Fixes: 3225717f6dfa ("RDMA/rxe: Replace red-black trees by xarrays")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Reviewed-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/sw/rxe/rxe_pool.c