lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070428071923.GB9545@APFDCB5C>
Date:	Sat, 28 Apr 2007 16:19:23 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	William Irwin <wli@...omorphy.com>
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@...omorphy.com>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ