]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ocfs2: fix mutex_unlock and possible memory leak in ocfs2_remove_btree_range
authorJoseph Qi <joseph.qi@huawei.com>
Wed, 19 Jun 2013 00:05:39 +0000 (10:05 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:12:48 +0000 (17:12 +1000)
commitc88b5f188398f4d122a2d9f7da6f9be8bcc75b5a
tree7ef99c961bc26d3fddcc1270e8a55f3ca3065f99
parent540688d21a859622edf99f0dfba348bbb1aacab1
ocfs2: fix mutex_unlock and possible memory leak in ocfs2_remove_btree_range

In ocfs2_remove_btree_range, when calling ocfs2_lock_refcount_tree and
ocfs2_prepare_refcount_change_for_del failed, it goes to out and then
tries to call mutex_unlock without mutex_lock before.  And when calling
ocfs2_reserve_blocks_for_rec_trunc failed, it should free ref_tree before
return.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/alloc.c