summaryrefslogtreecommitdiffstats
path: root/kernel/futex.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-12-06 20:39:03 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:41 -0800
commit95362fa90312ff2d52c0b4d42412cd7ceeb3b89b (patch)
tree9cb55f4dd53324500b84953f17490abea45cdf72 /kernel/futex.c
parent01afb2134ed079fa4551b4d26f62423df6790c09 (diff)
downloadlinux-95362fa90312ff2d52c0b4d42412cd7ceeb3b89b.tar.gz
linux-95362fa90312ff2d52c0b4d42412cd7ceeb3b89b.tar.bz2
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/futex.c')
-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);