From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: William Irwin <wli@holomorphy.com>
Subject: [PATCH] hugetlbfs: fix error path in module_init
Date: Sat, 28 Apr 2007 16:19:23 +0900 [thread overview]
Message-ID: <20070428071923.GB9545@APFDCB5C> (raw)
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;
}
next reply other threads:[~2007-04-28 7:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-28 7:19 Akinobu Mita [this message]
2007-04-28 7:44 ` Alexey Dobriyan
2007-04-28 10:58 ` Akinobu Mita
2007-04-28 14:46 ` William Lee Irwin III
2007-04-28 14:50 ` William Lee Irwin III
2007-04-28 16:18 ` Akinobu Mita
2007-04-28 16:29 ` [PATCH] hugetlbfs: add NULL check in hugetlb_zero_setup() Akinobu Mita
2007-04-28 18:15 ` William Lee Irwin III
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070428071923.GB9545@APFDCB5C \
--to=akinobu.mita@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wli@holomorphy.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®