summaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-12-12 11:30:03 +0100
committerJan Kara <jack@suse.cz>2019-12-16 12:59:32 +0100
commit5474ca7da6f34fa95e82edc747d5faa19cbdfb5c (patch)
tree011451e3cc0db5960a1a5d8f2093b3d3ea5475c4 /fs/reiserfs
parent34e92542da964304f41f97deee6e34085ad8106b (diff)
downloadlinux-stable-5474ca7da6f34fa95e82edc747d5faa19cbdfb5c.tar.gz
linux-stable-5474ca7da6f34fa95e82edc747d5faa19cbdfb5c.tar.bz2
linux-stable-5474ca7da6f34fa95e82edc747d5faa19cbdfb5c.zip
reiserfs: Fix memory leak of journal device string
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>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/super.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 3244037b1286..d127af64283e 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;
}
@@ -2240,6 +2241,7 @@ error_unlocked:
kfree(qf_names[j]);
}
#endif
+ kfree(sbi->s_jdev);
kfree(sbi);
s->s_fs_info = NULL;