summaryrefslogtreecommitdiffstats
path: root/fs/hugetlbfs
diff options
context:
space:
mode:
authorHillf Danton <dhillf@gmail.com>2012-03-21 16:34:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 17:55:00 -0700
commitd1d5e05ffdc110021ae7937802e88ae0d223dcdc (patch)
treed0960138966aa0436ffad1907f3ad14dcb625ddf /fs/hugetlbfs
parentb69add218d32450d6604bc9080f6e33e19b06f5e (diff)
downloadlinux-stable-d1d5e05ffdc110021ae7937802e88ae0d223dcdc.tar.gz
linux-stable-d1d5e05ffdc110021ae7937802e88ae0d223dcdc.tar.bz2
linux-stable-d1d5e05ffdc110021ae7937802e88ae0d223dcdc.zip
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/hugetlbfs')
-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)
if (error)
return error;
+ error = -ENOMEM;
hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
sizeof(struct hugetlbfs_inode_info),
0, 0, init_once);
@@ -1039,10 +1040,10 @@ static int __init init_hugetlbfs_fs(void)
}
error = PTR_ERR(vfsmount);
+ unregister_filesystem(&hugetlbfs_fs_type);
out:
- if (error)
- kmem_cache_destroy(hugetlbfs_inode_cachep);
+ kmem_cache_destroy(hugetlbfs_inode_cachep);
out2:
bdi_destroy(&hugetlbfs_backing_dev_info);
return error;