diff options
author | Jan Kara <jack@suse.cz> | 2019-12-12 13:30:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-05 17:43:36 +0300 |
commit | 1764dc15a6852b8e2b2d9ba412ef751f8a11c4b9 (patch) | |
tree | 072ef07a0ab047225fb34c9e2f1b7246553baeee /fs | |
parent | 732ecd4aad51d336b49b9be431219d173ac826c8 (diff) | |
download | linux-1764dc15a6852b8e2b2d9ba412ef751f8a11c4b9.tar.xz |
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")
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-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 a3507490be6e..6280efeceb0a 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -629,6 +629,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; } @@ -2243,6 +2244,7 @@ error_unlocked: kfree(qf_names[j]); } #endif + kfree(sbi->s_jdev); kfree(sbi); s->s_fs_info = NULL; |