diff options
author | Jan Kara <jack@suse.cz> | 2019-12-12 11:30:03 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2020-05-22 21:19:17 +0100 |
commit | 363f8afc312609a42015c8b8161a458e1749cd4c (patch) | |
tree | d0ffb2aa1b4ab2bb2fc47529c307c8792c5c390b | |
parent | d525915ba099d34e08606ef44bf8cdc899c18f95 (diff) | |
download | linux-stable-363f8afc312609a42015c8b8161a458e1749cd4c.tar.gz |
reiserfs: Fix memory leak of journal device string
commit 5474ca7da6f34fa95e82edc747d5faa19cbdfb5c upstream.
When a filesystem is mounted with jdev mount option, we store the
journal device name in an allocated string in superblock. However we
fail to ever free that string. Fix it.
Reported-by: syzbot+1c6756baf4b16b94d2a6@syzkaller.appspotmail.com
Fixes: c3aa077648e1 ("reiserfs: Properly display mount options in /proc/mounts")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | fs/reiserfs/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 7daf9e503f805..b2d6e9fc72aa8 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -589,6 +589,7 @@ static void reiserfs_put_super(struct super_block *s) reiserfs_write_unlock(s); mutex_destroy(&REISERFS_SB(s)->lock); destroy_workqueue(REISERFS_SB(s)->commit_wq); + kfree(REISERFS_SB(s)->s_jdev); kfree(s->s_fs_info); s->s_fs_info = NULL; } @@ -2188,6 +2189,7 @@ error_unlocked: kfree(qf_names[j]); } #endif + kfree(sbi->s_jdev); kfree(sbi); s->s_fs_info = NULL; |