Messages in this thread Patch in this message | | | Date | Sat, 28 Apr 2007 16:19:23 +0900 | From | Akinobu Mita <> | Subject | [PATCH] hugetlbfs: fix error path in module_init |
| |
init_hugetlbfs_fs() needs to unregister hugetlbfs when kern_mount() returns error.
Cc: William Irwin <wli@holomorphy.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
--- fs/hugetlbfs/inode.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
Index: 2.6-mm/fs/hugetlbfs/inode.c =================================================================== --- 2.6-mm.orig/fs/hugetlbfs/inode.c +++ 2.6-mm/fs/hugetlbfs/inode.c @@ -804,20 +804,23 @@ static int __init init_hugetlbfs_fs(void error = register_filesystem(&hugetlbfs_fs_type); if (error) - goto out; + goto out_cache; vfsmount = kern_mount(&hugetlbfs_fs_type); - if (!IS_ERR(vfsmount)) { - hugetlbfs_vfsmount = vfsmount; - return 0; + if (IS_ERR(vfsmount)) { + error = PTR_ERR(vfsmount); + goto out_fs; } + hugetlbfs_vfsmount = vfsmount; - error = PTR_ERR(vfsmount); + return 0; + +out_fs: + unregister_filesystem(&hugetlbfs_fs_type); +out_cache: + kmem_cache_destroy(hugetlbfs_inode_cachep); - out: - if (error) - kmem_cache_destroy(hugetlbfs_inode_cachep); return error; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |