reiserfs: Two small fixes
Subsystems (2)
Jan Kara
reviewercover reiserfs: Two small fixes
Hello,
these two patches fix two small issues in reiserfs, one of them spotted by syzbot (which made me look into the code and find the second). If nobody objects, I'll merge these through my tree.
Honza
Jan Kara
reviewerPATCH 1/2 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 [email protected]
Fixes c3aa077648e1 ("reiserfs: Properly display mount options in /proc/mounts")
Signed-off-by Jan Kara <[email protected]>
--- fs/reiserfs/super.c | 2 ++ 1 file changed, 2 insertions(+)
fs/reiserfs/super.c +2 -0
@@ -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 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) kfree(qf_names[j]); }#endif +kfree (sbi->s_jdev);kfree (sbi); s->s_fs_info =NULL ;
Signature · 1 line
2.16.4
Jan Kara
reviewerPATCH 2/2 reiserfs: Fix spurious unlock in reiserfs_fill_super() error handling
In reply to Jan KaraWhen we fail to allocate string for journal device name we jump to 'error' label which tries to unlock reiserfs write lock which is not held. Jump to 'error_unlocked' instead.
Fixes f32485be8397 ("reiserfs: delay reiserfs lock until journal initialization")
Signed-off-by Jan Kara <[email protected]>
--- fs/reiserfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/reiserfs/super.c +1 -1
@@ -1948,7 +1948,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)if (!sbi->s_jdev) {SWARN (silent, s,"" ,"Cannot allocate memory for " "journal device name" ); - goto error; + goto error_unlocked; } }#ifdef CONFIG_QUOTA
Signature · 1 line
2.16.4