Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752385AbdI0IVM (ORCPT ); Wed, 27 Sep 2017 04:21:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:37597 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752318AbdI0IVK (ORCPT ); Wed, 27 Sep 2017 04:21:10 -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 5/6] mm, mempool: use kmalloc_array_node Date: Wed, 27 Sep 2017 10:20:37 +0200 Message-Id: <20170927082038.3782-6-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: 774 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 --- mm/mempool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mempool.c b/mm/mempool.c index 1c0294858527..26f1b70c4a4e 100644 --- a/mm/mempool.c +++ b/mm/mempool.c @@ -188,7 +188,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) { kfree(pool); -- 2.13.5