]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
jffs2: unlock f->sem on error in jffs2_new_inode()
authorWang Guoli <andy.wangguoli@huawei.com>
Wed, 15 Jan 2014 05:54:32 +0000 (16:54 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 15 Jan 2014 05:54:32 +0000 (16:54 +1100)
commitc3ebf4ee66dbb9b9be4b9eabf948c47cb08cdf76
tree9b8ef142bd8f31f2450cb4ece8c01b9e6170a8eb
parent9af4715102d0dcb38ede1b90c59ebc7aa1c3db72
jffs2: unlock f->sem on error in jffs2_new_inode()

If jffs2_new_inode() succeeds, it returns with f->sem held, and the caller
is responsible for releasing the lock.  If it fails, it still returns with
the lock held, but the caller won't release the lock, which will lead to
deadlock.

Fix it by releasing the lock in jffs2_new_inode() on error.

Signed-off-by: Wang Guoli <andy.wangguoli@huawei.com>
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Wang Guoli <andy.wangguoli@huawei.com>
Cc: <stable@vger.kernel.org> # 2.6.34+
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/jffs2/fs.c