aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2006-01-03 10:49:18 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-03 10:49:18 -0500
commitac67c6247361b3b8644b34e5301a46d5069c1373 (patch)
treedd83147e304181e889eefa39e5056451031f4b5d /mm
parentc4c48d83e9ffb1c25cccd59d5ea9dda6ded01faf (diff)
parent88026842b0a760145aa71d69e74fbc9ec118ca44 (diff)
Merge branch 'master'
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index bec88c81244..72f402cc9c9 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -161,6 +161,10 @@ static struct mempolicy *mpol_new(int mode, nodemask_t *nodes)
switch (mode) {
case MPOL_INTERLEAVE:
policy->v.nodes = *nodes;
+ if (nodes_weight(*nodes) == 0) {
+ kmem_cache_free(policy_cache, policy);
+ return ERR_PTR(-EINVAL);
+ }
break;
case MPOL_PREFERRED:
policy->v.preferred_node = first_node(*nodes);