patch 'rawdev: fix calloc parameters' has been queued to stable release 22.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 7 02:30:55 CET 2024


Hi,

FYI, your patch has been queued to stable release 22.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/09/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/477478f17966c64992bedbff1c493b803d744ec8

Thanks.

Luca Boccassi

---
>From 477478f17966c64992bedbff1c493b803d744ec8 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at amd.com>
Date: Wed, 24 Jan 2024 18:54:00 +0000
Subject: [PATCH] rawdev: fix calloc parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 37ff33833b6b8932bfbc8e149d386ef23ccdc54e ]

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.0 20240108 (experimental)

[2]
Compiling C object .../lib/librte_rawdev.a.p/rawdev_rte_rawdev.c.o
../lib/rawdev/rte_rawdev.c: In function ‘handle_dev_dump’:
../lib/rawdev/rte_rawdev.c:659:29:
  error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
  argument and not in the later argument
  [-Werror=calloc-transposed-args]
  659 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
      |                         ^~~~

Fixes: e915d404eb72 ("rawdev: support telemetry dump rawdev")

Signed-off-by: Ferruh Yigit <ferruh.yigit at amd.com>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
Reviewed-by: Chengwen Feng <fengchengwen at huawei.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 lib/rawdev/rte_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/rawdev/rte_rawdev.c b/lib/rawdev/rte_rawdev.c
index 891e79dcd7..dcebe4f653 100644
--- a/lib/rawdev/rte_rawdev.c
+++ b/lib/rawdev/rte_rawdev.c
@@ -656,7 +656,7 @@ handle_dev_dump(const char *cmd __rte_unused,
 	if (!rte_rawdev_pmd_is_valid_dev(dev_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.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-07 01:05:38.226169715 +0000
+++ 0038-rawdev-fix-calloc-parameters.patch	2024-03-07 01:05:34.754939082 +0000
@@ -1 +1 @@
-From 37ff33833b6b8932bfbc8e149d386ef23ccdc54e Mon Sep 17 00:00:00 2001
+From 477478f17966c64992bedbff1c493b803d744ec8 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 37ff33833b6b8932bfbc8e149d386ef23ccdc54e ]
+
@@ -26 +27,0 @@
-Cc: stable at dpdk.org
@@ -37 +38 @@
-index 474bdc9540..4f8897b639 100644
+index 891e79dcd7..dcebe4f653 100644


More information about the stable mailing list