aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2006-10-01 02:27:21 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:19 -0400
commit52978be636374c4bfb61220b37fa12f55a071c46 (patch)
tree36444be7bdbc0cdd99d903c0ad87316c93427517 /mm
parent1a2f67b459bb7846d4a15924face63eb2683acc2 (diff)
[PATCH] kmemdup: some users
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index cf18f0942553..25788b1b7fcf 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1324,12 +1324,11 @@ struct mempolicy *__mpol_copy(struct mempolicy *old)
1324 atomic_set(&new->refcnt, 1); 1324 atomic_set(&new->refcnt, 1);
1325 if (new->policy == MPOL_BIND) { 1325 if (new->policy == MPOL_BIND) {
1326 int sz = ksize(old->v.zonelist); 1326 int sz = ksize(old->v.zonelist);
1327 new->v.zonelist = kmalloc(sz, SLAB_KERNEL); 1327 new->v.zonelist = kmemdup(old->v.zonelist, sz, SLAB_KERNEL);
1328 if (!new->v.zonelist) { 1328 if (!new->v.zonelist) {
1329 kmem_cache_free(policy_cache, new); 1329 kmem_cache_free(policy_cache, new);
1330 return ERR_PTR(-ENOMEM); 1330 return ERR_PTR(-ENOMEM);
1331 } 1331 }
1332 memcpy(new->v.zonelist, old->v.zonelist, sz);
1333 } 1332 }
1334 return new; 1333 return new;
1335} 1334}