summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDongliang Mu <mudongliangabcd@gmail.com>2021-10-27 22:34:41 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-06 07:49:41 +0100
commit23d5769a674cb80808239081b35699d347d88ee3 (patch)
treef7221807760e7a87f545236b103e8cbf70c80ae2 /fs
parentdb73f35365bf9928df8ee68269a0c6cc8b2b983e (diff)
downloadlinux-stable-23d5769a674cb80808239081b35699d347d88ee3.tar.gz
linux-stable-23d5769a674cb80808239081b35699d347d88ee3.tar.bz2
linux-stable-23d5769a674cb80808239081b35699d347d88ee3.zip
fs: reiserfs: remove useless new_opts in reiserfs_remount
commit 81dedaf10c20959bdf5624f9783f408df26ba7a4 upstream. Since the commit c3d98ea08291 ("VFS: Don't use save/replace_mount_options if not using generic_show_options") eliminates replace_mount_options in reiserfs_remount, but does not handle the allocated new_opts, it will cause memory leak in the reiserfs_remount. Because new_opts is useless in reiserfs_mount, so we fix this bug by removing the useless new_opts in reiserfs_remount. Fixes: c3d98ea08291 ("VFS: Don't use save/replace_mount_options if not using generic_show_options") Link: https://lore.kernel.org/r/20211027143445.4156459-1-mudongliangabcd@gmail.com Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/reiserfs/super.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 831a542c22c6..e5be1d747c03 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1443,7 +1443,6 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
unsigned long safe_mask = 0;
unsigned int commit_max_age = (unsigned int)-1;
struct reiserfs_journal *journal = SB_JOURNAL(s);
- char *new_opts;
int err;
char *qf_names[REISERFS_MAXQUOTAS];
unsigned int qfmt = 0;
@@ -1451,10 +1450,6 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
int i;
#endif
- new_opts = kstrdup(arg, GFP_KERNEL);
- if (arg && !new_opts)
- return -ENOMEM;
-
sync_filesystem(s);
reiserfs_write_lock(s);
@@ -1605,7 +1600,6 @@ out_ok_unlocked:
out_err_unlock:
reiserfs_write_unlock(s);
out_err:
- kfree(new_opts);
return err;
}