[PATCH] powerpc: Fix error path in kernel_thread function

Josh Boyer jwboyer at linux.vnet.ibm.com
Wed Oct 8 03:46:41 EST 2008


On Tue, Oct 07, 2008 at 12:10:03PM -0400, Josh Boyer wrote:
>From: Josh Poimboeuf <jpoimboe at us.ibm.com>
>
>The powerpc 32-bit and 64-bit kernel_thread functions don't properly
>propagate errors being returned by the clone syscall.  (In the case of
>error, the syscall exit code returns a positive errno in r3 and sets
>the CR0[SO] bit.)
>
>This patch fixes that by negating r3 if CR0[SO] is set after the syscall.
>
>Signed-off-by: Josh Poimboeuf <jpoimboe at us.ibm.com>
>Signed-off-by: Josh Boyer <jwboyer at linux.vnet.ibm.com>

FYI, I boot tested this on a G5 this morning.  A variant for an older
kernel was also tested on a 440-based board.

Not what I would call exhaustive testing, but at least it didn't
crash and burn.

josh



More information about the Linuxppc-dev mailing list