Messages in this thread Patch in this message | | | From | Johannes Thumshirn <> | Subject | [PATCH 2/6] block: use kmalloc_array_node | Date | Wed, 27 Sep 2017 10:20:34 +0200 |
| |
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 calculation.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c index 98a18609755e..49f9dc0eb47c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1979,7 +1979,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; -- 2.13.5
| |