mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 08:52:27 +00:00
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. [[email protected]: remove unneeded test of `error'] Signed-off-by: Hillf Danton <[email protected]> Acked-by: David Rientjes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
committed by
Linus Torvalds
parent
b69add218d
commit
d1d5e05ffd
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user