Skip to content

Commit

Permalink
[PATCH] futex: init error check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Dec 7, 2006
1 parent 01afb21 commit 95362fa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 95362fa

Please sign in to comment.