@@ -, +, @@ --- --- linux-2.6.14.orig/mm/mempolicy.c 2005-10-28 01:02:08.000000000 +0100 +++ linux-2.6.14.orig/mm/mempolicy.c 2006-01-10 21:37:14.000000000 +0000 @@ -219,6 +219,10 @@ switch (mode) { case MPOL_INTERLEAVE: bitmap_copy(policy->v.nodes, nodes, MAX_NUMNODES); + if (bitmap_weight(nodes, MAX_NUMNODES) == 0) { + kmem_cache_free(policy_cache, policy); + return ERR_PTR(-EINVAL); + } break; case MPOL_PREFERRED: policy->v.preferred_node = find_first_bit(nodes, MAX_NUMNODES);