]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - kernel/exit.c
cpuset,mm: fix no node to alloc memory when changing cpuset's mems
[thirdparty/kernel/linux.git] / kernel / exit.c
index eabca5a73a85b70d8d1d9f2ea95c05ae6c27c1e2..019a2843bf958e6727f19c9b30ceb4b0da8e7cb9 100644 (file)
@@ -1002,8 +1002,10 @@ NORET_TYPE void do_exit(long code)
 
        exit_notify(tsk, group_dead);
 #ifdef CONFIG_NUMA
+       task_lock(tsk);
        mpol_put(tsk->mempolicy);
        tsk->mempolicy = NULL;
+       task_unlock(tsk);
 #endif
 #ifdef CONFIG_FUTEX
        if (unlikely(current->pi_state_cache))