diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fork.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 99076dbe27d8..f1c16b3dd8ac 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -205,9 +205,10 @@ static bool try_release_thread_stack_to_cache(struct vm_struct *vm) unsigned int i; for (i = 0; i < NR_CACHED_STACKS; i++) { - if (this_cpu_cmpxchg(cached_stacks[i], NULL, vm) != NULL) - continue; - return true; + struct vm_struct *tmp = NULL; + + if (this_cpu_try_cmpxchg(cached_stacks[i], &tmp, vm)) + return true; } return false; } |