Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59d6d39f authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Paul Mackerras
Browse files

[PATCH] spufs: fix module refcount race



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: default avatarArnd Bergmann <arndb@de.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent a819f8ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
	}