]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/spufs: reference context while dropping state mutex in scheduler
authorJeremy Kerr <jk@ozlabs.org>
Thu, 14 Aug 2008 04:59:12 +0000 (14:59 +1000)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 14 Aug 2008 04:59:12 +0000 (14:59 +1000)
commit76c94211f1ac076343be4da596b8992ecad9f6d4
treee6d9d9375f0f7894931749b687e66a19e5dffa84
parent22984a3824edf37ab4b17b169a5b6a12bf9f4f63
powerpc/spufs: reference context while dropping state mutex in scheduler

Based on an original patch from Christoph Hellwig <hch@lst.de>.

Currently, there is a possible reference-after-free in the spusched
code - contexts may be freed after we have released their state_mutex
in spusched_tick and find_victim.

This change takes a reference to the context before releasing the
mutex, so that the context doesn't get destroyed.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
arch/powerpc/platforms/cell/spufs/sched.c