提交 7f708931 编写于 作者: J Jan H. Schönherr 提交者: Paul E. McKenney

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: NJan H. Schönherr <schnhrr@cs.tu-berlin.de>
Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
上级 cefcb602
...@@ -183,7 +183,7 @@ static inline void list_splice_init_rcu(struct list_head *list, ...@@ -183,7 +183,7 @@ static inline void list_splice_init_rcu(struct list_head *list,
struct list_head *last = list->prev; struct list_head *last = list->prev;
struct list_head *at = head->next; struct list_head *at = head->next;
if (list_empty(head)) if (list_empty(list))
return; return;
/* "first" and "last" tracking list, so initialize it. */ /* "first" and "last" tracking list, so initialize it. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册