From patchwork Wed Jun 7 07:41:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Hai X-Patchwork-Id: 128273 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BDCB642C4A; Wed, 7 Jun 2023 09:45:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4706942C4D; Wed, 7 Jun 2023 09:45:27 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 5287140695 for ; Wed, 7 Jun 2023 09:45:24 +0200 (CEST) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QbfQV2xZ0zqTr2; Wed, 7 Jun 2023 15:40:34 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 7 Jun 2023 15:45:21 +0800 From: Jie Hai To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , =?utf-8?q?Morten_Br=C3=B8?= =?utf-8?q?rup?= , Chengwen Feng CC: , Subject: [PATCH v2 01/13] ethdev: fix incorrect argument of calloc Date: Wed, 7 Jun 2023 15:41:56 +0800 Message-ID: <20230607074209.4798-2-haijie1@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230607074209.4798-1-haijie1@huawei.com> References: <20230530090510.56812-1-haijie1@huawei.com> <20230607074209.4798-1-haijie1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The 'calloc' uses number as first argument, sizeof is generally wrong. This patch fixes it. Fixes: 8af559f94cef ("ethdev: support telemetry private dump") Cc: stable@dpdk.org Signed-off-by: Jie Hai Acked-by: Ferruh Yigit --- lib/ethdev/rte_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index d46e74504e64..503d500429c0 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -6548,7 +6548,7 @@ eth_dev_handle_port_dump_priv(const char *cmd __rte_unused, if (!rte_eth_dev_is_valid_port(port_id)) return -EINVAL; - buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN); + buf = calloc(RTE_TEL_MAX_SINGLE_STRING_LEN, sizeof(char)); if (buf == NULL) return -ENOMEM;