diff options
-rw-r--r-- | ipc/shm.c | 3 | ||||
-rw-r--r-- | mm/mempolicy.c | 7 |
2 files changed, 6 insertions, 4 deletions
@@ -274,8 +274,7 @@ static struct mempolicy *shm_get_policy(struct vm_area_struct *vma, | |||
274 | else if (vma->vm_policy) { | 274 | else if (vma->vm_policy) { |
275 | pol = vma->vm_policy; | 275 | pol = vma->vm_policy; |
276 | mpol_get(pol); /* get_vma_policy() expects this */ | 276 | mpol_get(pol); /* get_vma_policy() expects this */ |
277 | } else | 277 | } |
278 | pol = current->mempolicy; | ||
279 | return pol; | 278 | return pol; |
280 | } | 279 | } |
281 | #endif | 280 | #endif |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index c6c61ea6bb8c..8924aaf4665c 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -1262,7 +1262,7 @@ asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len, | |||
1262 | * @task != current]. It is the caller's responsibility to | 1262 | * @task != current]. It is the caller's responsibility to |
1263 | * free the reference in these cases. | 1263 | * free the reference in these cases. |
1264 | */ | 1264 | */ |
1265 | static struct mempolicy * get_vma_policy(struct task_struct *task, | 1265 | static struct mempolicy *get_vma_policy(struct task_struct *task, |
1266 | struct vm_area_struct *vma, unsigned long addr) | 1266 | struct vm_area_struct *vma, unsigned long addr) |
1267 | { | 1267 | { |
1268 | struct mempolicy *pol = task->mempolicy; | 1268 | struct mempolicy *pol = task->mempolicy; |
@@ -1270,7 +1270,10 @@ static struct mempolicy * get_vma_policy(struct task_struct *task, | |||
1270 | 1270 | ||
1271 | if (vma) { | 1271 | if (vma) { |
1272 | if (vma->vm_ops && vma->vm_ops->get_policy) { | 1272 | if (vma->vm_ops && vma->vm_ops->get_policy) { |
1273 | pol = vma->vm_ops->get_policy(vma, addr); | 1273 | struct mempolicy *vpol = vma->vm_ops->get_policy(vma, |
1274 | addr); | ||
1275 | if (vpol) | ||
1276 | pol = vpol; | ||
1274 | shared_pol = 1; /* if pol non-NULL, add ref below */ | 1277 | shared_pol = 1; /* if pol non-NULL, add ref below */ |
1275 | } else if (vma->vm_policy && | 1278 | } else if (vma->vm_policy && |
1276 | vma->vm_policy->policy != MPOL_DEFAULT) | 1279 | vma->vm_policy->policy != MPOL_DEFAULT) |