diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2006-09-30 23:27:21 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 00:39:19 -0700 |
commit | 52978be636374c4bfb61220b37fa12f55a071c46 (patch) | |
tree | 36444be7bdbc0cdd99d903c0ad87316c93427517 /mm/mempolicy.c | |
parent | 1a2f67b459bb7846d4a15924face63eb2683acc2 (diff) | |
download | op-kernel-dev-52978be636374c4bfb61220b37fa12f55a071c46.zip op-kernel-dev-52978be636374c4bfb61220b37fa12f55a071c46.tar.gz |
[PATCH] kmemdup: some users
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r-- | mm/mempolicy.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index cf18f09..25788b1 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1324,12 +1324,11 @@ struct mempolicy *__mpol_copy(struct mempolicy *old) atomic_set(&new->refcnt, 1); if (new->policy == MPOL_BIND) { int sz = ksize(old->v.zonelist); - new->v.zonelist = kmalloc(sz, SLAB_KERNEL); + new->v.zonelist = kmemdup(old->v.zonelist, sz, SLAB_KERNEL); if (!new->v.zonelist) { kmem_cache_free(policy_cache, new); return ERR_PTR(-ENOMEM); } - memcpy(new->v.zonelist, old->v.zonelist, sz); } return new; } |