summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-12-07 05:39:03 +0100
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 17:39:41 +0100
commit95362fa90312ff2d52c0b4d42412cd7ceeb3b89b (patch)
tree9cb55f4dd53324500b84953f17490abea45cdf72 /kernel
parent[PATCH] reiser: replace kmalloc+memset with kzalloc (diff)
downloadlinux-95362fa90312ff2d52c0b4d42412cd7ceeb3b89b.tar.xz
linux-95362fa90312ff2d52c0b4d42412cd7ceeb3b89b.zip
[PATCH] futex: init error check
Check register_filesystem() and kern_mount() return values. Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/futex.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 7c0d0d4fa7f7..d60b7f7a8cc3 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1857,10 +1857,16 @@ static struct file_system_type futex_fs_type = {
static int __init init(void)
{
- unsigned int i;
+ int i = register_filesystem(&futex_fs_type);
+
+ if (i)
+ return i;
- register_filesystem(&futex_fs_type);
futex_mnt = kern_mount(&futex_fs_type);
+ if (IS_ERR(futex_mnt)) {
+ unregister_filesystem(&futex_fs_type);
+ return PTR_ERR(futex_mnt);
+ }
for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
INIT_LIST_HEAD(&futex_queues[i].chain);