Skip to content

Commit 7f70893

Browse files
Jan H. Schönherrpaulmck
authored andcommitted
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>
1 parent cefcb60 commit 7f70893

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/linux/rculist.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static inline void list_splice_init_rcu(struct list_head *list,
183183
struct list_head *last = list->prev;
184184
struct list_head *at = head->next;
185185

186-
if (list_empty(head))
186+
if (list_empty(list))
187187
return;
188188

189189
/* "first" and "last" tracking list, so initialize it. */

0 commit comments

Comments
 (0)