Fix a leak in affs_fill_super()

This change “Fix a leak in affs_fill_super()” (commit afc70ed) in Linux kernel is authored by Al Viro <viro [at] zeniv.linux.org.uk> on Sat Jan 23 23:38:27 2010 -0500.

Description of "Fix a leak in affs_fill_super()"

The change “Fix a leak in affs_fill_super()” introduces changes as follows.

Fix a leak in affs_fill_super()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Linux kernel releases containing commit afc70ed

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "Fix a leak in affs_fill_super()"

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 fs/affs/super.c | 2 ++
 1 file changed, 2 insertions(+)
 
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 104fdcb3a7fc..b2a5958c6191 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -316,6 +316,8 @@ 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 */

The commit for this change in Linux stable tree is afc70ed (patch).

Last modified: 2020/02/10