aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 5d6fb339de03..5bc0a96beb51 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2094,7 +2094,7 @@ void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol)
2094 NODEMASK_SCRATCH(scratch); 2094 NODEMASK_SCRATCH(scratch);
2095 2095
2096 if (!scratch) 2096 if (!scratch)
2097 return; 2097 goto put_mpol;
2098 /* contextualize the tmpfs mount point mempolicy */ 2098 /* contextualize the tmpfs mount point mempolicy */
2099 new = mpol_new(mpol->mode, mpol->flags, &mpol->w.user_nodemask); 2099 new = mpol_new(mpol->mode, mpol->flags, &mpol->w.user_nodemask);
2100 if (IS_ERR(new)) 2100 if (IS_ERR(new))
@@ -2103,19 +2103,20 @@ void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol)
2103 task_lock(current); 2103 task_lock(current);
2104 ret = mpol_set_nodemask(new, &mpol->w.user_nodemask, scratch); 2104 ret = mpol_set_nodemask(new, &mpol->w.user_nodemask, scratch);
2105 task_unlock(current); 2105 task_unlock(current);
2106 mpol_put(mpol); /* drop our ref on sb mpol */
2107 if (ret) 2106 if (ret)
2108 goto put_free; 2107 goto put_new;
2109 2108
2110 /* Create pseudo-vma that contains just the policy */ 2109 /* Create pseudo-vma that contains just the policy */
2111 memset(&pvma, 0, sizeof(struct vm_area_struct)); 2110 memset(&pvma, 0, sizeof(struct vm_area_struct));
2112 pvma.vm_end = TASK_SIZE; /* policy covers entire file */ 2111 pvma.vm_end = TASK_SIZE; /* policy covers entire file */
2113 mpol_set_shared_policy(sp, &pvma, new); /* adds ref */ 2112 mpol_set_shared_policy(sp, &pvma, new); /* adds ref */
2114 2113
2115put_free: 2114put_new:
2116 mpol_put(new); /* drop initial ref */ 2115 mpol_put(new); /* drop initial ref */
2117free_scratch: 2116free_scratch:
2118 NODEMASK_SCRATCH_FREE(scratch); 2117 NODEMASK_SCRATCH_FREE(scratch);
2118put_mpol:
2119 mpol_put(mpol); /* drop our incoming ref on sb mpol */
2119 } 2120 }
2120} 2121}
2121 2122