Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3991682pxa; Sun, 9 Aug 2020 19:39:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsHZMDs7KzzqFT26VaO667Cr8exrHVZWGdMzbELZ2SysiFX/jWun9CNw6PfaJ9fspzmGUo X-Received: by 2002:a05:6402:3128:: with SMTP id dd8mr18631025edb.97.1597027170950; Sun, 09 Aug 2020 19:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597027170; cv=none; d=google.com; s=arc-20160816; b=TFX4Sowb4SexnBA3rxfw8IL2x4HUIkakbyMbZ5RIICOcZXsiAWZzvB0UrrXxN+OmWh q+X1ZUTbqq8idvZPbMTcoIvKad+xYu3ZvlCzYa9QlXmlcMnF7H+OCOBlsH5NL+z8qX0Q lbJX4XfWbsbCzPqh8EC85pufPVViGuKuZ0ZB6XyYv4q8DrTLB2VihpiL7it7kFL0l3tP GSqbKd4HA9iLUncAIvQEiYPRnYmmceNrpOuE4QaFk7EbxmcJujP5aisTts60x3jvf+LV 4L1lzlERU8gMcKSkRQQL9NT+IYRQ1XGCh9G5hfmkb4PEBp6vvwLFJ8EaKnXuMg4+24Te 6+6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=wVi+uwiaHx5UG0g0gAG6uosXCDB5OpJA70IvpgJgQ+8=; b=vlqAFamfPaAtiOuXDdg+w5BJ+D+4eTZr3f38DqODxWRrfAfQVGTQUQRUox8QijOzvB FPIom32nQYibfNdxpIjDp96RZScznDINcOfyDyJp6TWHwzQt74oSuDb5sq2nz56Y82VF HBxZqZRtytF9YYtXjU/9ahmn6fohp4IHW8EqgMJVDf58phzdMozeefCN8NDUQpC2k+hh wOwh7kbrQMnvCJb80QdTmdr3ajZAmC7g/94T01y54+KR/u7+AGii91djWoFQclHWlKEr 8pf9TTrMzlXfHJz54MhInXKI2hrhp0sjFO/xzT2r5ZJZuBRVhNdnCxh1geMjC9SH0ncw z9QQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id si6si10355101ejb.331.2020.08.09.19.39.06; Sun, 09 Aug 2020 19:39:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbgHJCie (ORCPT + 99 others); Sun, 9 Aug 2020 22:38:34 -0400 Received: from smtp23.cstnet.cn ([159.226.251.23]:35750 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726219AbgHJCie (ORCPT ); Sun, 9 Aug 2020 22:38:34 -0400 Received: from localhost (unknown [159.226.5.99]) by APP-03 (Coremail) with SMTP id rQCowABHTxsfszBfrMpoAQ--.26273S2; Mon, 10 Aug 2020 10:38:23 +0800 (CST) From: Xu Wang To: snelson@pensando.io, drivers@pensando.io, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Xu Wang Subject: [PATCH] ionic_lif: Use devm_kcalloc() in ionic_qcq_alloc() Date: Mon, 10 Aug 2020 02:38:07 +0000 Message-Id: <20200810023807.9260-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: rQCowABHTxsfszBfrMpoAQ--.26273S2 X-Coremail-Antispam: 1UD129KBjvJXoW7AF1UKw4UGFWDCw17uryfJFb_yoW8Gw1xpa 1xJFy2vr1UXF4I9an7Xw4kZa45X3yxGrW3Grsru3s3uwnrJFW8XF48KFW8XFW0kFZ5CF10 vF1qy3W3ZFs5A3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkK14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr 1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv67AKxVW8Jr0_Cr1UMcvjeVCFs4IE7xkEbV WUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK 6r4UMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI 0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y 0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Wr1j6rW3Jr1lIxAIcVC2z280aVAFwI0_Jr0_ Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbZ2-5 UUUUU== X-Originating-IP: [159.226.5.99] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCQUEA102ZfUVcgAAsX Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". Signed-off-by: Xu Wang --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 1944bf5264db..26988ad7ec97 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -412,7 +412,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, new->flags = flags; - new->q.info = devm_kzalloc(dev, sizeof(*new->q.info) * num_descs, + new->q.info = devm_kcalloc(dev, num_descs, sizeof(*new->q.info), GFP_KERNEL); if (!new->q.info) { netdev_err(lif->netdev, "Cannot allocate queue info\n"); @@ -462,7 +462,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, new->intr.index = IONIC_INTR_INDEX_NOT_ASSIGNED; } - new->cq.info = devm_kzalloc(dev, sizeof(*new->cq.info) * num_descs, + new->cq.info = devm_kcalloc(dev, num_descs, sizeof(*new->cq.info), GFP_KERNEL); if (!new->cq.info) { netdev_err(lif->netdev, "Cannot allocate completion queue info\n"); -- 2.17.1