Skip to content

Commit 5474ca7

Browse files
committed
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: c3aa077 ("reiserfs: Properly display mount options in /proc/mounts") CC: stable@vger.kernel.org Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 34e9254 commit 5474ca7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/reiserfs/super.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ static void reiserfs_put_super(struct super_block *s)
629629
reiserfs_write_unlock(s);
630630
mutex_destroy(&REISERFS_SB(s)->lock);
631631
destroy_workqueue(REISERFS_SB(s)->commit_wq);
632+
kfree(REISERFS_SB(s)->s_jdev);
632633
kfree(s->s_fs_info);
633634
s->s_fs_info = NULL;
634635
}
@@ -2240,6 +2241,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
22402241
kfree(qf_names[j]);
22412242
}
22422243
#endif
2244+
kfree(sbi->s_jdev);
22432245
kfree(sbi);
22442246

22452247
s->s_fs_info = NULL;

0 commit comments

Comments
 (0)