rxe: Fix double unlock in cq_ex polling
[ Upstream commit 5e7aa41022adb9f8ab8de1edf5ab2f5ed412e97a ]
Fix a bug in rxe cq_ex polling where the cq lock is unlocked twice causing
undefined behavior. According the man page, the user should call
`cq_end_poll` even if `cq_next_poll` returns ENOENT. This fix removes the
`pthread_spin_unlock` call in `cq_next_poll` so that it is correctly
called only once in `cq_end_poll`.
Fixes: e3af50b ("Provider/rxe: Implement Ibv_create_cq_ex verb")
Signed-off-by: Justin Funston <justin.funston@bytedance.com>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
diff --git a/providers/rxe/rxe.c b/providers/rxe/rxe.c
index 7cd1604..32a524f 100644
--- a/providers/rxe/rxe.c
+++ b/providers/rxe/rxe.c
@@ -269,7 +269,6 @@
if (check_cq_queue_empty(cq)) {
store_consumer_index(cq->queue, cq->cur_index);
- pthread_spin_unlock(&cq->lock);
errno = ENOENT;
return errno;
}