The 'calloc' uses number as first argument, sizeof is generally wrong.
This patch fixes it.

Fixes: 8af559f94cef ("ethdev: support telemetry private dump")
Cc: sta...@dpdk.org

Signed-off-by: Jie Hai <haij...@huawei.com>
---
 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;
 
-- 
2.33.0

Reply via email to