[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220609070656.1446121-1-dzm91@hust.edu.cn>
Date: Thu, 9 Jun 2022 15:06:56 +0800
From: Dongliang Mu <dzm91@...t.edu.cn>
To: Zhu Yanjun <zyjzyj2000@...il.com>, Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>
Cc: Dongliang Mu <mudongliangabcd@...il.com>,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] rxe: fix xa_alloc_cycle() error return value check again
From: Dongliang Mu <mudongliangabcd@...il.com>
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.
Signed-off-by: Dongliang Mu <mudongliangabcd@...il.com>
---
drivers/infiniband/sw/rxe/rxe_pool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_pool.c b/drivers/infiniband/sw/rxe/rxe_pool.c
index 1cc8e847ccff..e9f3bbd8d605 100644
--- a/drivers/infiniband/sw/rxe/rxe_pool.c
+++ b/drivers/infiniband/sw/rxe/rxe_pool.c
@@ -167,7 +167,7 @@ int __rxe_add_to_pool(struct rxe_pool *pool, struct rxe_pool_elem *elem)
err = xa_alloc_cyclic(&pool->xa, &elem->index, elem, pool->limit,
&pool->next, GFP_KERNEL);
- if (err)
+ if (err < 0)
goto err_cnt;
return 0;
--
2.25.1
Powered by blists - more mailing lists