summaryrefslogtreecommitdiffstats
path: root/Documentation/RCU
diff options
context:
space:
mode:
authorAlan Huang <mmpgouride@gmail.com>2023-06-13 00:57:01 +0000
committerPaul E. McKenney <paulmck@kernel.org>2023-07-14 14:55:56 -0700
commitbc25e7c3598e56992120505ea09f6cf0651da63b (patch)
treeadbd6e596c02ecf5c563dccec0fe5a60d30d63d6 /Documentation/RCU
parent401013e2ad9e1ba329a91a7b66779d8cb780bcd0 (diff)
downloadlinux-stable-bc25e7c3598e56992120505ea09f6cf0651da63b.tar.gz
linux-stable-bc25e7c3598e56992120505ea09f6cf0651da63b.tar.bz2
linux-stable-bc25e7c3598e56992120505ea09f6cf0651da63b.zip
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 <mmpgouride@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'Documentation/RCU')
-rw-r--r--Documentation/RCU/rculist_nulls.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/Documentation/RCU/rculist_nulls.rst b/Documentation/RCU/rculist_nulls.rst
index 9a734bf54b76..0612a6387d8e 100644
--- a/Documentation/RCU/rculist_nulls.rst
+++ b/Documentation/RCU/rculist_nulls.rst
@@ -29,8 +29,10 @@ algorithms:
rcu_read_lock()
obj = lockless_lookup(key);
if (obj) {
- if (!try_get_ref(obj)) // might fail for free objects
+ if (!try_get_ref(obj)) { // might fail for free objects
+ rcu_read_unlock();
goto begin;
+ }
/*
* Because a writer could delete object, and a writer could
* reuse these object before the RCU grace period, we