aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ufs/super.c')
-rw-r--r--fs/ufs/super.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 0072cb33ebec..73deff475e63 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -633,6 +633,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent)
633 unsigned block_size, super_block_size; 633 unsigned block_size, super_block_size;
634 unsigned flags; 634 unsigned flags;
635 unsigned super_block_offset; 635 unsigned super_block_offset;
636 int ret = -EINVAL;
636 637
637 uspi = NULL; 638 uspi = NULL;
638 ubh = NULL; 639 ubh = NULL;
@@ -1065,12 +1066,16 @@ magic_found:
1065 uspi->s_maxsymlinklen = 1066 uspi->s_maxsymlinklen =
1066 fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen); 1067 fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen);
1067 1068
1068 inode = iget(sb, UFS_ROOTINO); 1069 inode = ufs_iget(sb, UFS_ROOTINO);
1069 if (!inode || is_bad_inode(inode)) 1070 if (IS_ERR(inode)) {
1071 ret = PTR_ERR(inode);
1070 goto failed; 1072 goto failed;
1073 }
1071 sb->s_root = d_alloc_root(inode); 1074 sb->s_root = d_alloc_root(inode);
1072 if (!sb->s_root) 1075 if (!sb->s_root) {
1076 ret = -ENOMEM;
1073 goto dalloc_failed; 1077 goto dalloc_failed;
1078 }
1074 1079
1075 ufs_setup_cstotal(sb); 1080 ufs_setup_cstotal(sb);
1076 /* 1081 /*
@@ -1092,7 +1097,7 @@ failed:
1092 kfree(sbi); 1097 kfree(sbi);
1093 sb->s_fs_info = NULL; 1098 sb->s_fs_info = NULL;
1094 UFSD("EXIT (FAILED)\n"); 1099 UFSD("EXIT (FAILED)\n");
1095 return -EINVAL; 1100 return ret;
1096 1101
1097failed_nomem: 1102failed_nomem:
1098 UFSD("EXIT (NOMEM)\n"); 1103 UFSD("EXIT (NOMEM)\n");
@@ -1326,7 +1331,6 @@ static ssize_t ufs_quota_write(struct super_block *, int, const char *, size_t,
1326static const struct super_operations ufs_super_ops = { 1331static const struct super_operations ufs_super_ops = {
1327 .alloc_inode = ufs_alloc_inode, 1332 .alloc_inode = ufs_alloc_inode,
1328 .destroy_inode = ufs_destroy_inode, 1333 .destroy_inode = ufs_destroy_inode,
1329 .read_inode = ufs_read_inode,
1330 .write_inode = ufs_write_inode, 1334 .write_inode = ufs_write_inode,
1331 .delete_inode = ufs_delete_inode, 1335 .delete_inode = ufs_delete_inode,
1332 .put_super = ufs_put_super, 1336 .put_super = ufs_put_super,