Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752586AbdI0IWi (ORCPT ); Wed, 27 Sep 2017 04:22:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:37530 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752007AbdI0IVA (ORCPT ); Wed, 27 Sep 2017 04:21:00 -0400 From: Johannes Thumshirn To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Damien Le Moal , Christoph Hellwig , Johannes Thumshirn Subject: [PATCH 2/6] block: use kmalloc_array_node Date: Wed, 27 Sep 2017 10:20:34 +0200 Message-Id: <20170927082038.3782-3-jthumshirn@suse.de> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170927082038.3782-1-jthumshirn@suse.de> References: <20170927082038.3782-1-jthumshirn@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 772 Lines: 24 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 --- 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