Commit 63762f50 authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Linus Torvalds
Browse files

mm/mempool.c: use kmalloc_array_node()

Now that we have a NUMA-aware version of kmalloc_array() we can use it
instead of kmalloc_node() without an overflow check in the size


Signed-off-by: default avatarJohannes Thumshirn <>
Reviewed-by: default avatarChristoph Lameter <>
Cc: Christoph Hellwig <>
Cc: Damien Le Moal <>
Cc: David Rientjes <>
Cc: "David S. Miller" <>
Cc: Doug Ledford <>
Cc: Hal Rosenstock <>
Cc: Jens Axboe <>
Cc: Joonsoo Kim <>
Cc: Mike Marciniszyn <>
Cc: Pekka Enberg <>
Cc: Santosh Shilimkar <>
Cc: Sean Hefty <>
Cc: Vlastimil Babka <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 3c073478
......@@ -189,7 +189,7 @@ mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn,
pool = kzalloc_node(sizeof(*pool), gfp_mask, node_id);
if (!pool)
return NULL;
pool->elements = kmalloc_node(min_nr * sizeof(void *),
pool->elements = kmalloc_array_node(min_nr, sizeof(void *),
gfp_mask, node_id);
if (!pool->elements) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment