LFQ: Fix unpaired lock/unlock
[userspace-rcu.git] / tests / test_urcu_lfq.c
index 90587b728791d382e4c711efb6854c4cdfba811b..9560c74f138639ddf0e40f2463562ede8faee613 100644 (file)
@@ -333,8 +333,10 @@ void *dequeue(struct queue *q, bool *not_empty)
 
                if (head == tail) {
                        /* If all three are consistent, the queue is empty.  */
-                       if (!next)
+                       if (!next) {
+                               rcu_read_unlock();
                                return NULL;
+                       }
 
                        /* Help moving tail further.  */
                        uatomic_cmpxchg(&q->tail, tail, next);
This page took 0.022681 seconds and 4 git commands to generate.