[PATCH] ext4: fix unbalanced mutex unlock

From: Nicolas Kaiser
Date: Mon Oct 25 2010 - 19:20:37 EST


Although the mutex isn't locked yet, if ext4_li_request_new
fails, the mutex would get unlocked on the error path.

Signed-off-by: Nicolas Kaiser <nikai@xxxxxxxxx>
---
fs/ext4/super.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d0c3328..8bca022 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2915,10 +2915,8 @@ static int ext4_register_li_request(struct super_block *sb,
}

elr = ext4_li_request_new(sb, first_not_zeroed);
- if (!elr) {
- ret = -ENOMEM;
- goto out;
- }
+ if (!elr)
+ return -ENOMEM;

mutex_lock(&ext4_li_mtx);

--
1.7.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/