[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5ee2a090-1709-5ca0-1e78-8db1f3ded973@paragon-software.com>
Date: Tue, 28 Sep 2021 20:17:29 +0300
From: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
To: <ntfs3@...ts.linux.dev>
CC: <linux-kernel@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
<kari.argillander@...il.com>
Subject: [PATCH v2 1/3] fs/ntfs3: Fix memory leak if fill_super failed
Restore fc->s_fs_info to free memory allocated in ntfs_init_fs_context.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
---
fs/ntfs3/super.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 800897777eb0..aff90f70e7bf 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -1242,6 +1242,10 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
return 0;
out:
iput(inode);
+
+ /* Restore fc->s_fs_info to free memory allocated in ntfs_init_fs_context. */
+ fc->s_fs_info = sbi;
+
return err;
}
--
2.33.0
Powered by blists - more mailing lists