jffs2: remove from wait queue after schedule()
authorLi Zefan <lizefan@huawei.com>
Wed, 12 Feb 2014 20:44:57 +0000 (12:44 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Apr 2014 00:19:06 +0000 (17:19 -0700)
commit5e7d38dd797403f965854d3e25e5982a739343d6
tree385f6aeea680b0dc749ded93e5dce952aaaab672
parentbd82a0a4284847fb03dc76f9a36bd993f542afe1
jffs2: remove from wait queue after schedule()

commit 3ead9578443b66ddb3d50ed4f53af8a0c0298ec5 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>
fs/jffs2/nodemgmt.c