[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20140326195759.9d0700eaf743d0df04c89fab@skynet.be>
Date: Wed, 26 Mar 2014 19:57:59 +0100
From: Fabian Frederick <fabf@...net.be>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: "fengguang.wu" <fengguang.wu@...el.com>
Subject: [PATCH linux-next] ufs: sb mutex merge + mutex_destroy: fix
mutex_destroy was also called when trying to mount volume in read/write without write support enabled.
Reported by Fengguang Wu.
Signed-off-by: Fabian Frederick <fabf@...net.be>
---
fs/ufs/super.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index d05cf89..dd4144e 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -798,7 +798,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent)
if (!(sb->s_flags & MS_RDONLY)) {
printk("ufs was compiled with read-only support, "
"can't be mounted as read-write\n");
- goto failed;
+ goto failed_noreadwrite;
}
#endif
mutex_init(&sbi->mutex);
@@ -1255,10 +1255,12 @@ magic_found:
return 0;
failed:
+ mutex_destroy(&sbi->mutex);
+
+failed_noreadwrite:
if (ubh)
ubh_brelse_uspi (uspi);
kfree (uspi);
- mutex_destroy(&sbi->mutex);
kfree(sbi);
sb->s_fs_info = NULL;
UFSD("EXIT (FAILED)\n");
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists