Skip to content

Commit 91cbf01

Browse files
Revert "ubifs: Fix memory leak bug in alloc_ubifs_info() error path"
This reverts commit 9163e01. At the point when ubifs_fill_super() runs, we have already a reference to the super block. So upon deactivate_locked_super() c will get free()'ed via ->kill_sb(). Cc: Wenwen Wang <[email protected]> Fixes: 9163e01 ("ubifs: Fix memory leak bug in alloc_ubifs_info() error path") Reported-by: https://twitter.com/grsecurity/status/1180609139359277056 Signed-off-by: Richard Weinberger <[email protected]> Tested-by: Romain Izard <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 7cc7720 commit 91cbf01

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/ubifs/super.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,10 +2267,8 @@ static struct dentry *ubifs_mount(struct file_system_type *fs_type, int flags,
22672267
}
22682268
} else {
22692269
err = ubifs_fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
2270-
if (err) {
2271-
kfree(c);
2270+
if (err)
22722271
goto out_deact;
2273-
}
22742272
/* We do not support atime */
22752273
sb->s_flags |= SB_ACTIVE;
22762274
if (IS_ENABLED(CONFIG_UBIFS_ATIME_SUPPORT))

0 commit comments

Comments
 (0)