aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/affs/super.c')
-rw-r--r--fs/affs/super.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index b53e5d0ec65c..3c45d49c0d26 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -113,7 +113,6 @@ static void destroy_inodecache(void)
113static const struct super_operations affs_sops = { 113static const struct super_operations affs_sops = {
114 .alloc_inode = affs_alloc_inode, 114 .alloc_inode = affs_alloc_inode,
115 .destroy_inode = affs_destroy_inode, 115 .destroy_inode = affs_destroy_inode,
116 .read_inode = affs_read_inode,
117 .write_inode = affs_write_inode, 116 .write_inode = affs_write_inode,
118 .put_inode = affs_put_inode, 117 .put_inode = affs_put_inode,
119 .drop_inode = affs_drop_inode, 118 .drop_inode = affs_drop_inode,
@@ -271,6 +270,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
271 unsigned long mount_flags; 270 unsigned long mount_flags;
272 int tmp_flags; /* fix remount prototype... */ 271 int tmp_flags; /* fix remount prototype... */
273 u8 sig[4]; 272 u8 sig[4];
273 int ret = -EINVAL;
274 274
275 pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options"); 275 pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
276 276
@@ -444,7 +444,12 @@ got_root:
444 444
445 /* set up enough so that it can read an inode */ 445 /* set up enough so that it can read an inode */
446 446
447 root_inode = iget(sb, root_block); 447 root_inode = affs_iget(sb, root_block);
448 if (IS_ERR(root_inode)) {
449 ret = PTR_ERR(root_inode);
450 goto out_error_noinode;
451 }
452
448 sb->s_root = d_alloc_root(root_inode); 453 sb->s_root = d_alloc_root(root_inode);
449 if (!sb->s_root) { 454 if (!sb->s_root) {
450 printk(KERN_ERR "AFFS: Get root inode failed\n"); 455 printk(KERN_ERR "AFFS: Get root inode failed\n");
@@ -461,12 +466,13 @@ got_root:
461out_error: 466out_error:
462 if (root_inode) 467 if (root_inode)
463 iput(root_inode); 468 iput(root_inode);
469out_error_noinode:
464 kfree(sbi->s_bitmap); 470 kfree(sbi->s_bitmap);
465 affs_brelse(root_bh); 471 affs_brelse(root_bh);
466 kfree(sbi->s_prefix); 472 kfree(sbi->s_prefix);
467 kfree(sbi); 473 kfree(sbi);
468 sb->s_fs_info = NULL; 474 sb->s_fs_info = NULL;
469 return -EINVAL; 475 return ret;
470} 476}
471 477
472static int 478static int