Skip to content

Commit cc8ece8

Browse files
lizf-osgregkh
authored andcommitted
jffs2: remove from wait queue after schedule()
commit 3ead957 upstream. @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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3a196f4 commit cc8ece8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/jffs2/nodemgmt.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
179179
spin_unlock(&c->erase_completion_lock);
180180

181181
schedule();
182+
remove_wait_queue(&c->erase_wait, &wait);
182183
} else
183184
spin_unlock(&c->erase_completion_lock);
184185
} else if (ret)

0 commit comments

Comments
 (0)