[PATCH 02/20] AFFS: Free sbi memory in error path

Jan Blunck
2009-11-18T09:31:58Z

I spotted the missing kfree() while removing the BKL.

Signed-off-by: Jan Blunck <jblunck@suse.de>
---
fs/affs/super.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/affs/super.c b/fs/affs/super.c
index 104fdcb..058c2c7 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -316,7 +316,7 @@ 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");
- return -EINVAL;
+ goto out_error_free_sbi;
}
/* N.B. after this point s_prefix must be released */

@@ -498,6 +498,7 @@ out_error_noinode:
kfree(sbi->s_bitmap);
affs_brelse(root_bh);
kfree(sbi->s_prefix);
+out_error_free_sbi:
kfree(sbi);
sb->s_fs_info = NULL;
return ret;
--
1.6.4.2