]> 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>
Thu, 27 Jun 2013 23:51:05 +0000 (09:51 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:17 +0000 (16:37 +1000)
commitb30a2715344c632c7ba084e57e283a53eb719fef
treefd1148be20d3b96836f40347c9baf5ca6b8a1322
parent2ad961e9f5b0be5f6a096cdebba9b3ad049072ce
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