aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index cb41c31e7c87..b4eababc8198 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -443,7 +443,7 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask,
443 struct mempolicy *new; 443 struct mempolicy *new;
444 DECLARE_BITMAP(nodes, MAX_NUMNODES); 444 DECLARE_BITMAP(nodes, MAX_NUMNODES);
445 445
446 if (mode > MPOL_MAX) 446 if (mode < 0 || mode > MPOL_MAX)
447 return -EINVAL; 447 return -EINVAL;
448 err = get_nodes(nodes, nmask, maxnode, mode); 448 err = get_nodes(nodes, nmask, maxnode, mode);
449 if (err) 449 if (err)
@@ -1138,11 +1138,11 @@ void mpol_free_shared_policy(struct shared_policy *p)
1138 while (next) { 1138 while (next) {
1139 n = rb_entry(next, struct sp_node, nd); 1139 n = rb_entry(next, struct sp_node, nd);
1140 next = rb_next(&n->nd); 1140 next = rb_next(&n->nd);
1141 rb_erase(&n->nd, &p->root);
1141 mpol_free(n->policy); 1142 mpol_free(n->policy);
1142 kmem_cache_free(sn_cache, n); 1143 kmem_cache_free(sn_cache, n);
1143 } 1144 }
1144 spin_unlock(&p->lock); 1145 spin_unlock(&p->lock);
1145 p->root = RB_ROOT;
1146} 1146}
1147 1147
1148/* assumes fs == KERNEL_DS */ 1148/* assumes fs == KERNEL_DS */