Commit 684bdc7f authored by Jan Blunck's avatar Jan Blunck Committed by Al Viro

JFS: Free sbi memory in error path

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

[akpm@linux-foundation.org: avoid multiple returns so it doesn't happen again]
Signed-off-by: default avatarJan Blunck <jblunck@suse.de>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 404e7812
...@@ -446,10 +446,8 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -446,10 +446,8 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
/* initialize the mount flag and determine the default error handler */ /* initialize the mount flag and determine the default error handler */
flag = JFS_ERR_REMOUNT_RO; flag = JFS_ERR_REMOUNT_RO;
if (!parse_options((char *) data, sb, &newLVSize, &flag)) { if (!parse_options((char *) data, sb, &newLVSize, &flag))
kfree(sbi); goto out_kfree;
return -EINVAL;
}
sbi->flag = flag; sbi->flag = flag;
#ifdef CONFIG_JFS_POSIX_ACL #ifdef CONFIG_JFS_POSIX_ACL
...@@ -458,7 +456,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -458,7 +456,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
if (newLVSize) { if (newLVSize) {
printk(KERN_ERR "resize option for remount only\n"); printk(KERN_ERR "resize option for remount only\n");
return -EINVAL; goto out_kfree;
} }
/* /*
...@@ -478,7 +476,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -478,7 +476,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
inode = new_inode(sb); inode = new_inode(sb);
if (inode == NULL) { if (inode == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto out_kfree; goto out_unload;
} }
inode->i_ino = 0; inode->i_ino = 0;
inode->i_nlink = 1; inode->i_nlink = 1;
...@@ -550,9 +548,10 @@ out_mount_failed: ...@@ -550,9 +548,10 @@ out_mount_failed:
make_bad_inode(sbi->direct_inode); make_bad_inode(sbi->direct_inode);
iput(sbi->direct_inode); iput(sbi->direct_inode);
sbi->direct_inode = NULL; sbi->direct_inode = NULL;
out_kfree: out_unload:
if (sbi->nls_tab) if (sbi->nls_tab)
unload_nls(sbi->nls_tab); unload_nls(sbi->nls_tab);
out_kfree:
kfree(sbi); kfree(sbi);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment