diff options
-rw-r--r-- | mm/mempolicy.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index e58725aff7e9..f22c55947181 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -162,12 +162,6 @@ static const struct mempolicy_operations { | |||
162 | enum mpol_rebind_step step); | 162 | enum mpol_rebind_step step); |
163 | } mpol_ops[MPOL_MAX]; | 163 | } mpol_ops[MPOL_MAX]; |
164 | 164 | ||
165 | /* Check that the nodemask contains at least one populated zone */ | ||
166 | static int is_valid_nodemask(const nodemask_t *nodemask) | ||
167 | { | ||
168 | return nodes_intersects(*nodemask, node_states[N_MEMORY]); | ||
169 | } | ||
170 | |||
171 | static inline int mpol_store_user_nodemask(const struct mempolicy *pol) | 165 | static inline int mpol_store_user_nodemask(const struct mempolicy *pol) |
172 | { | 166 | { |
173 | return pol->flags & MPOL_MODE_FLAGS; | 167 | return pol->flags & MPOL_MODE_FLAGS; |
@@ -202,7 +196,7 @@ static int mpol_new_preferred(struct mempolicy *pol, const nodemask_t *nodes) | |||
202 | 196 | ||
203 | static int mpol_new_bind(struct mempolicy *pol, const nodemask_t *nodes) | 197 | static int mpol_new_bind(struct mempolicy *pol, const nodemask_t *nodes) |
204 | { | 198 | { |
205 | if (!is_valid_nodemask(nodes)) | 199 | if (nodes_empty(*nodes)) |
206 | return -EINVAL; | 200 | return -EINVAL; |
207 | pol->v.nodes = *nodes; | 201 | pol->v.nodes = *nodes; |
208 | return 0; | 202 | return 0; |
@@ -234,7 +228,7 @@ static int mpol_set_nodemask(struct mempolicy *pol, | |||
234 | nodes = NULL; /* explicit local allocation */ | 228 | nodes = NULL; /* explicit local allocation */ |
235 | else { | 229 | else { |
236 | if (pol->flags & MPOL_F_RELATIVE_NODES) | 230 | if (pol->flags & MPOL_F_RELATIVE_NODES) |
237 | mpol_relative_nodemask(&nsc->mask2, nodes,&nsc->mask1); | 231 | mpol_relative_nodemask(&nsc->mask2, nodes, &nsc->mask1); |
238 | else | 232 | else |
239 | nodes_and(nsc->mask2, *nodes, nsc->mask1); | 233 | nodes_and(nsc->mask2, *nodes, nsc->mask1); |
240 | 234 | ||