提交 3ead9578 编写于 作者: L Li Zefan 提交者: Brian Norris

jffs2: remove from wait queue after schedule()

@wait is a local variable, so if we don't remove it from the wait queue
list, later wake_up() may end up accessing invalid memory.

This was spotted by eyes.
Signed-off-by: NLi Zefan <lizefan@huawei.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 f4f6a0be
...@@ -179,6 +179,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, ...@@ -179,6 +179,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
spin_unlock(&c->erase_completion_lock); spin_unlock(&c->erase_completion_lock);
schedule(); schedule();
remove_wait_queue(&c->erase_wait, &wait);
} else } else
spin_unlock(&c->erase_completion_lock); spin_unlock(&c->erase_completion_lock);
} else if (ret) } else if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册