diff options
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 cf18f094255..25788b1b7fc 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 | } |