aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2014-02-12 15:44:57 -0500
committerBrian Norris <computersforpeace@gmail.com>2014-03-11 01:42:27 -0400
commit3ead9578443b66ddb3d50ed4f53af8a0c0298ec5 (patch)
treec817c8731c17c945bed6db2c0aa4a7359e92f49c /fs/jffs2
parentf4f6a0be01498f42b023d5aa71275bc05478d331 (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 'fs/jffs2')
-rw-r--r--fs/jffs2/nodemgmt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
index 03310721712f..bbae5b1a833a 100644
--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -179,6 +179,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
179 spin_unlock(&c->erase_completion_lock); 179 spin_unlock(&c->erase_completion_lock);
180 180
181 schedule(); 181 schedule();
182 remove_wait_queue(&c->erase_wait, &wait);
182 } else 183 } else
183 spin_unlock(&c->erase_completion_lock); 184 spin_unlock(&c->erase_completion_lock);
184 } else if (ret) 185 } else if (ret)