diff options
author | Li Zefan <lizefan@huawei.com> | 2014-02-12 12:44:57 -0800 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-07-16 07:22:11 +0200 |
commit | 52c50c78546d89cdd9787193781ae7b4856e5293 (patch) | |
tree | 2ce9a07f6bb201cf7a559b7b78eaa2c7d89c8841 /cpukit/libfs/src/jffs2/src/nodemgmt.c | |
parent | e650f4fc303d76348807d70b49c51c2dd59ae98f (diff) |
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: Li 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | cpukit/libfs/src/jffs2/src/nodemgmt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cpukit/libfs/src/jffs2/src/nodemgmt.c b/cpukit/libfs/src/jffs2/src/nodemgmt.c index 40fa34c692..6cb8dc4d6f 100644 --- a/cpukit/libfs/src/jffs2/src/nodemgmt.c +++ b/cpukit/libfs/src/jffs2/src/nodemgmt.c @@ -181,6 +181,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, spin_unlock(&c->erase_completion_lock); schedule(); + remove_wait_queue(&c->erase_wait, &wait); } else spin_unlock(&c->erase_completion_lock); } else if (ret) |