lkml.org 
[lkml]   [2021]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 1/3] fs/ntfs3: Fix memory leak if fill_super failed
From
Restore fc->s_fs_info to free memory allocated in ntfs_init_fs_context.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
fs/ntfs3/super.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 800897777eb0..7099d9b1f3aa 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -1308,6 +1308,9 @@ int ntfs_discard(struct ntfs_sb_info *sbi, CLST lcn, CLST len)
if (err == -EOPNOTSUPP)
sbi->flags |= NTFS_FLAGS_NODISCARD;

+ /* Restore fc->s_fs_info to free memory allocated in ntfs_init_fs_context. */
+ fc->s_fs_info = sbi;
+
return err;
}

--
2.33.0

\
 
 \ /
  Last update: 2021-09-27 17:48    [W:0.112 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site