]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drivers/infiniband/sw/rdmavt/qp.c: use kmalloc_array_node()
authorJohannes Thumshirn <jthumshirn@suse.de>
Thu, 16 Nov 2017 01:32:41 +0000 (17:32 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Nov 2017 02:21:02 +0000 (18:21 -0800)
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.

Link: http://lkml.kernel.org/r/20170927082038.3782-5-jthumshirn@suse.de
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Lameter <cl@linux.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Damien Le Moal <damien.lemoal@wdc.com>
Cc: David Rientjes <rientjes@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Mike Marciniszyn <infinipath@intel.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/infiniband/sw/rdmavt/qp.c

index b670cb9d200630215ac38cc591aed2891ac1d25f..27a1ad79d654dc8b1ebf14f60128e84beb471a57 100644 (file)
@@ -238,7 +238,7 @@ int rvt_driver_qp_init(struct rvt_dev_info *rdi)
        rdi->qp_dev->qp_table_size = rdi->dparms.qp_table_size;
        rdi->qp_dev->qp_table_bits = ilog2(rdi->dparms.qp_table_size);
        rdi->qp_dev->qp_table =
-               kmalloc_node(rdi->qp_dev->qp_table_size *
+               kmalloc_array_node(rdi->qp_dev->qp_table_size,
                             sizeof(*rdi->qp_dev->qp_table),
                             GFP_KERNEL, rdi->dparms.node);
        if (!rdi->qp_dev->qp_table)