Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e4ab747efa8e78562ec6782b08bbf21a00aba1b
Commit:     3e4ab747efa8e78562ec6782b08bbf21a00aba1b
Parent:     43fe105a5c91b2f00ea7f900ed307fe980410612
Author:     Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 23 15:23:55 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Feb 23 17:12:15 2008 -0800

    futex: fix init order
    
    When the futex init code fails to initialize the futex pseudo file system it
    returns early without initializing the hash queues.  Should the boot succeed
    then a futex syscall which tries to enqueue a waiter on the hashqueue will
    crash due to the unitilialized plist heads.
    
    Initialize the hash queues before the filesystem.
    
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Lennert Buytenhek <[EMAIL PROTECTED]>
    Cc: Riku Voipio <[EMAIL PROTECTED]>
    Cc: <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/futex.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 221f212..c21f667 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2145,8 +2145,14 @@ static struct file_system_type futex_fs_type = {
 
 static int __init init(void)
 {
-       int i = register_filesystem(&futex_fs_type);
+       int i;
 
+       for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
+               plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
+               spin_lock_init(&futex_queues[i].lock);
+       }
+
+       i = register_filesystem(&futex_fs_type);
        if (i)
                return i;
 
@@ -2156,10 +2162,6 @@ static int __init init(void)
                return PTR_ERR(futex_mnt);
        }
 
-       for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
-               plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
-               spin_lock_init(&futex_queues[i].lock);
-       }
        return 0;
 }
 __initcall(init);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to