powerpc: harden the clock ATB probe a bit
authorJens Axboe <axboe@kernel.dk>
Tue, 26 Feb 2013 15:11:49 +0000 (16:11 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Feb 2013 15:11:49 +0000 (16:11 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/arch-ppc.h

index 751762750dd5081b5710466b0d4b3c9b6d60b353..0cc0cbda7d69890e10ff41816d836b4189684963 100644 (file)
@@ -96,11 +96,11 @@ static void atb_clocktest(void)
        pid = fork();
        if (!pid)
                atb_child();
        pid = fork();
        if (!pid)
                atb_child();
-       else {
+       else if (pid != -1) {
                int status;
 
                int status;
 
-               wait(&status);
-               if (!WIFEXITED(status))
+               pid = wait(&status);
+               if (pid == -1 || !WIFEXITED(status))
                        arch_flags &= ~ARCH_FLAG_1;
                else
                        arch_flags |= ARCH_FLAG_1;
                        arch_flags &= ~ARCH_FLAG_1;
                else
                        arch_flags |= ARCH_FLAG_1;