linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: fix unbalanced mutex unlock
@ 2010-10-25 23:15 Nicolas Kaiser
  2010-10-27 20:50 ` Ted Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Kaiser @ 2010-10-25 23:15 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Andreas Dilger, linux-ext4, linux-kernel

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@nikai.net>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-28 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-25 23:15 [PATCH] ext4: fix unbalanced mutex unlock Nicolas Kaiser
2010-10-27 20:50 ` Ted Ts'o
2010-10-28 10:04   ` Nicolas Kaiser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).