aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/mempolicy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 290fb5bf0440..3cec080faa23 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1730,10 +1730,12 @@ struct mempolicy *__mpol_dup(struct mempolicy *old)
1730 1730
1731 if (!new) 1731 if (!new)
1732 return ERR_PTR(-ENOMEM); 1732 return ERR_PTR(-ENOMEM);
1733 rcu_read_lock();
1733 if (current_cpuset_is_being_rebound()) { 1734 if (current_cpuset_is_being_rebound()) {
1734 nodemask_t mems = cpuset_mems_allowed(current); 1735 nodemask_t mems = cpuset_mems_allowed(current);
1735 mpol_rebind_policy(old, &mems); 1736 mpol_rebind_policy(old, &mems);
1736 } 1737 }
1738 rcu_read_unlock();
1737 *new = *old; 1739 *new = *old;
1738 atomic_set(&new->refcnt, 1); 1740 atomic_set(&new->refcnt, 1);
1739 return new; 1741 return new;