]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/spufs: Fix coredump of SPU contexts
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 29 May 2017 10:26:07 +0000 (20:26 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 1 Jun 2017 09:54:40 +0000 (19:54 +1000)
commit09822edd1d91b80a2c40365dbf2aad7156d605db
tree4c8ee57d363423843dbe5d4ffd2057f711a8ebed
parenta95e9ae8f99f270d77873b7bc3c4d41865f33679
powerpc/spufs: Fix coredump of SPU contexts

If a process dumps core while it has SPU contexts active then we have
code to also dump information about the SPU contexts.

Unfortunately it's been broken for 3 1/2 years, and we didn't notice. In
commit c6a77c2a48a9 ("spufs: get rid of dump_emit() wrappers") the nread
variable was removed and rc used instead. That means when the loop exits
successfully, rc has the number of bytes read, but it's then used as the
return value for the function, which should return 0 on success.

So fix it by setting rc = 0 before returning in the success case.

Fixes: c6a77c2a48a9 ("spufs: get rid of dump_emit() wrappers")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/cell/spufs/coredump.c