Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1d5e05f authored by Hillf Danton's avatar Hillf Danton Committed by Linus Torvalds
Browse files

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: default avatarHillf Danton <dhillf@gmail.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b69add21
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1021,6 +1021,7 @@ static int __init init_hugetlbfs_fs(void)
	if (error)
	if (error)
		return error;
		return error;


	error = -ENOMEM;
	hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
	hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
					sizeof(struct hugetlbfs_inode_info),
					sizeof(struct hugetlbfs_inode_info),
					0, 0, init_once);
					0, 0, init_once);
@@ -1039,9 +1040,9 @@ static int __init init_hugetlbfs_fs(void)
	}
	}


	error = PTR_ERR(vfsmount);
	error = PTR_ERR(vfsmount);
	unregister_filesystem(&hugetlbfs_fs_type);


 out:
 out:
	if (error)
	kmem_cache_destroy(hugetlbfs_inode_cachep);
	kmem_cache_destroy(hugetlbfs_inode_cachep);
 out2:
 out2:
	bdi_destroy(&hugetlbfs_backing_dev_info);
	bdi_destroy(&hugetlbfs_backing_dev_info);