Skip to content

Commit

Permalink
[PATCH] spufs: fix module refcount race
Browse files Browse the repository at this point in the history
One of the two users of spufs_calls.owner still has a race
when calling try_module_get while the module is removed.
This makes it use the correct instance of owner.

Noticed by Milton Miller.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Arnd Bergmann authored and Paul Mackerras committed Jan 9, 2006
1 parent a819f8b commit 59d6d39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/spu_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ asmlinkage long sys_spu_create(const char __user *name,
struct module *owner = spufs_calls.owner;

ret = -ENOSYS;
if (owner && try_module_get(spufs_calls.owner)) {
if (owner && try_module_get(owner)) {
ret = spufs_calls.create_thread(name, flags, mode);
module_put(owner);
}
Expand Down

0 comments on commit 59d6d39

Please sign in to comment.