[POWERPC] spusched: Fix null pointer dereference in find_victim
authorChristoph Hellwig <hch@lst.de>
Wed, 19 Sep 2007 04:38:12 +0000 (14:38 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 19 Sep 2007 05:26:29 +0000 (15:26 +1000)
commitc0e7b4aa1c09ea992808ea8c079141bc8dd0f5bc
tree04526571476d3f4e5f28f2043c025b72275c6b4a
parentc2f828977ba5d17c13debba374ea252d18e5ccfb
[POWERPC] spusched: Fix null pointer dereference in find_victim

find_victim can dereference a NULL pointer when iterating over the list
of victim spus because list_mutex only guarantees spu->ct to be stable,
but of course not to be non-NULL.

Also fix find_victim to not call spu_unbind_context without list_mutex
because that violates the above guarantee.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/cell/spufs/sched.c