Skip to content

Commit 81dedaf

Browse files
mudongliangjankara
authored andcommitted
fs: reiserfs: remove useless new_opts in reiserfs_remount
Since the commit c3d98ea ("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: c3d98ea ("VFS: Don't use save/replace_mount_options if not using generic_show_options") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dongliang Mu <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent e96a186 commit 81dedaf

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

fs/reiserfs/super.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,18 +1437,13 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
14371437
unsigned long safe_mask = 0;
14381438
unsigned int commit_max_age = (unsigned int)-1;
14391439
struct reiserfs_journal *journal = SB_JOURNAL(s);
1440-
char *new_opts;
14411440
int err;
14421441
char *qf_names[REISERFS_MAXQUOTAS];
14431442
unsigned int qfmt = 0;
14441443
#ifdef CONFIG_QUOTA
14451444
int i;
14461445
#endif
14471446

1448-
new_opts = kstrdup(arg, GFP_KERNEL);
1449-
if (arg && !new_opts)
1450-
return -ENOMEM;
1451-
14521447
sync_filesystem(s);
14531448
reiserfs_write_lock(s);
14541449

@@ -1599,7 +1594,6 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
15991594
out_err_unlock:
16001595
reiserfs_write_unlock(s);
16011596
out_err:
1602-
kfree(new_opts);
16031597
return err;
16041598
}
16051599

0 commit comments

Comments
 (0)