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 7517627..0cc0cbd 100644 (file)
@@ -96,11 +96,11 @@ static void atb_clocktest(void)
        pid = fork();
        if (!pid)
                atb_child();
-       else {
+       else if (pid != -1) {
                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;