diff options
author | Jan H. Schönherr <schnhrr@cs.tu-berlin.de> | 2011-07-19 15:10:26 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-07-20 17:10:20 -0400 |
commit | 7f70893173b056df691b2ee7546bb44fd9abae6a (patch) | |
tree | 5ac9a61694116b0743b3f407ee935bb07e9271e2 | |
parent | cefcb602012482003ca2ccc44fcba628d006e4bd (diff) |
rcu: Fix wrong check in list_splice_init_rcu()
If the list to be spliced is empty, then list_splice_init_rcu() has
nothing to do. Unfortunately, list_splice_init_rcu() does not check
the list to be spliced; it instead checks the list to be spliced into.
This results in memory leaks given current usage. This commit
therefore fixes the empty-list check.
Signed-off-by: Jan H. Schönherr <schnhrr@cs.tu-berlin.de>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | include/linux/rculist.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index e3beb315517a..d079290843a9 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -183,7 +183,7 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
183 | struct list_head *last = list->prev; | 183 | struct list_head *last = list->prev; |
184 | struct list_head *at = head->next; | 184 | struct list_head *at = head->next; |
185 | 185 | ||
186 | if (list_empty(head)) | 186 | if (list_empty(list)) |
187 | return; | 187 | return; |
188 | 188 | ||
189 | /* "first" and "last" tracking list, so initialize it. */ | 189 | /* "first" and "last" tracking list, so initialize it. */ |