aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorHillf Danton <dhillf@gmail.com>2012-03-21 19:34:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 20:55:00 -0400
commitd1d5e05ffdc110021ae7937802e88ae0d223dcdc (patch)
treed0960138966aa0436ffad1907f3ad14dcb625ddf /fs
parentb69add218d32450d6604bc9080f6e33e19b06f5e (diff)
hugetlbfs: return error code when initializing module
Return an errno upon failure to create inode kmem cache, and unregister the FS upon failure to mount. [akpm@linux-foundation.org: remove unneeded test of `error'] Signed-off-by: Hillf Danton <dhillf@gmail.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/hugetlbfs/inode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 631329f3de63..269163324b73 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -1021,6 +1021,7 @@ static int __init init_hugetlbfs_fs(void)
1021 if (error) 1021 if (error)
1022 return error; 1022 return error;
1023 1023
1024 error = -ENOMEM;
1024 hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache", 1025 hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
1025 sizeof(struct hugetlbfs_inode_info), 1026 sizeof(struct hugetlbfs_inode_info),
1026 0, 0, init_once); 1027 0, 0, init_once);
@@ -1039,10 +1040,10 @@ static int __init init_hugetlbfs_fs(void)
1039 } 1040 }
1040 1041
1041 error = PTR_ERR(vfsmount); 1042 error = PTR_ERR(vfsmount);
1043 unregister_filesystem(&hugetlbfs_fs_type);
1042 1044
1043 out: 1045 out:
1044 if (error) 1046 kmem_cache_destroy(hugetlbfs_inode_cachep);
1045 kmem_cache_destroy(hugetlbfs_inode_cachep);
1046 out2: 1047 out2:
1047 bdi_destroy(&hugetlbfs_backing_dev_info); 1048 bdi_destroy(&hugetlbfs_backing_dev_info);
1048 return error; 1049 return error;