mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 17:51:57 +09:00
jffs2: remove from wait queue after schedule()
commit 3ead957844 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3a196f46fc
commit
cc8ece834b
@@ -179,6 +179,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)
|
||||
|
||||
Reference in New Issue
Block a user