From: Fabian Frederick Date: Tue, 6 May 2014 19:50:11 +0000 (-0700) Subject: fs/affs/super.c: bugfix / double free X-Git-Tag: v4.0~1900^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d353efd02357a74753cd45f367a2d3d357fd6904;p=platform%2Fkernel%2Flinux-amlogic.git fs/affs/super.c: bugfix / double free Commit 842a859db26b ("affs: use ->kill_sb() to simplify ->put_super() and failure exits of ->mount()") adds .kill_sb which frees sbi but doesn't remove sbi free in case of parse_options error causing double free+random crash. Signed-off-by: Fabian Frederick Cc: Alexander Viro Cc: [3.14.x] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/affs/super.c b/fs/affs/super.c index 6d589f2..895ac7d 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -340,8 +340,6 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent) &blocksize,&sbi->s_prefix, sbi->s_volume, &mount_flags)) { printk(KERN_ERR "AFFS: Error parsing options\n"); - kfree(sbi->s_prefix); - kfree(sbi); return -EINVAL; } /* N.B. after this point s_prefix must be released */