Commit 22af2c50 authored by Li Zefan's avatar Li Zefan Committed by Ben Hutchings

jffs2: remove from wait queue after schedule()

commit 3ead9578 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: default avatarLi Zefan <lizefan@huawei.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent b58d5a52
...@@ -128,6 +128,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, ...@@ -128,6 +128,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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment