Commit d904bfa7 authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Linus Torvalds

block/blk-mq.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

Link: default avatarJohannes Thumshirn <>
Reviewed-by: default avatarChristoph Lameter <>
Cc: Pekka Enberg <>
Cc: David Rientjes <>
Cc: Joonsoo Kim <>
Cc: Damien Le Moal <>
Cc: Christoph Hellwig <>
Cc: Jens Axboe <>
Cc: "David S. Miller" <>
Cc: Doug Ledford <>
Cc: Hal Rosenstock <>
Cc: Mike Marciniszyn <>
Cc: Santosh Shilimkar <>
Cc: Sean Hefty <>
Cc: Vlastimil Babka <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 5799b255
......@@ -2047,7 +2047,7 @@ static int blk_mq_init_hctx(struct request_queue *q,
* Allocate space for all possible cpus to avoid allocation at
* runtime
hctx->ctxs = kmalloc_node(nr_cpu_ids * sizeof(void *),
hctx->ctxs = kmalloc_array_node(nr_cpu_ids, sizeof(void *),
GFP_KERNEL, node);
if (!hctx->ctxs)
goto unregister_cpu_notifier;
Markdown is supported
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