[PATCH] spufs: fix module refcount race
authorArnd Bergmann <arnd@arndb.de>
Fri, 9 Dec 2005 18:04:15 +0000 (19:04 +0100)
committerPaul Mackerras <paulus@samba.org>
Mon, 9 Jan 2006 03:53:11 +0000 (14:53 +1100)
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>
arch/powerpc/platforms/cell/spu_syscalls.c

index 91d564d..261b507 100644 (file)
@@ -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);
        }