lkml.org 
[lkml]   [2021]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fs: reiserfs: free new_opts in reiserfs_remount
Date
Since the commit c3d98ea08291 ("VFS: Don't use save/replace_mount_options
if not using generic_show_options") eliminates replace_mount_options
in reiserfs, but did not handle the allocated new_opts,
it will cause memory leak in the reiserfs_remount.

Fix this by freeing new_opts in the reiserfs_remount temporarily.

Fixes: c3d98ea08291 ("VFS: Don't use save/replace_mount_options if not using generic_show_options")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
---
fs/reiserfs/super.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 58481f8d63d5..b36865c8b66a 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1594,6 +1594,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
}

out_ok_unlocked:
+ kfree(new_opts);
return 0;

out_err_unlock:
--
2.25.1
\
 
 \ /
  Last update: 2021-10-27 05:41    [W:0.042 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site