Skip to content

Commit bc25e7c

Browse files
alanskindpaulmckrcu
authored andcommitted
docs/RCU: Add the missing rcu_read_unlock()
We should exit the RCU read-side critical section before re-entering. Signed-off-by: Alan Huang <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 401013e commit bc25e7c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Documentation/RCU/rculist_nulls.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ algorithms:
2929
rcu_read_lock()
3030
obj = lockless_lookup(key);
3131
if (obj) {
32-
if (!try_get_ref(obj)) // might fail for free objects
32+
if (!try_get_ref(obj)) { // might fail for free objects
33+
rcu_read_unlock();
3334
goto begin;
35+
}
3436
/*
3537
* Because a writer could delete object, and a writer could
3638
* reuse these object before the RCU grace period, we

0 commit comments

Comments
 (0)