patch 'pipeline: 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:52 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/eb18df799b665566066f305efd3ddf0b2f113da2

Thanks.

Luca Boccassi

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

[ upstream commit 0594ae0c42773d62aff870df25e73394f7f0a5a5 ]

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 20231102 (experimental)

[2]
 Compiling C object .../pipeline_rte_swx_pipeline_spec.c.o
.../rte_swx_pipeline_spec.c: In function ‘pipeline_spec_parse’:
../lib/pipeline/rte_swx_pipeline_spec.c:2893:11:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct pipeline_spec’ with size ‘144’ [-Walloc-size]
 2893 |         s = calloc(sizeof(struct pipeline_spec), 1);
      |           ^

.../rte_swx_pipeline_spec.c: In function ‘pipeline_iospec_parse’:
../lib/pipeline/rte_swx_pipeline_spec.c:4244:11:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct pipeline_iospec’ with size ‘64’ [-Walloc-size]
 4244 |         s = calloc(sizeof(struct pipeline_iospec), 1);
      |           ^

Fixes: 30c4abb90942 ("pipeline: rework specification file-based pipeline build")
Fixes: 54cae37ef4ef ("pipeline: support I/O specification")

Signed-off-by: Ferruh Yigit <ferruh.yigit at amd.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
---
 lib/pipeline/rte_swx_pipeline_spec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pipeline/rte_swx_pipeline_spec.c b/lib/pipeline/rte_swx_pipeline_spec.c
index 9116f38ed2..833436b831 100644
--- a/lib/pipeline/rte_swx_pipeline_spec.c
+++ b/lib/pipeline/rte_swx_pipeline_spec.c
@@ -2841,7 +2841,7 @@ pipeline_spec_parse(FILE *spec,
 	}
 
 	/* Memory allocation. */
-	s = calloc(sizeof(struct pipeline_spec), 1);
+	s = calloc(1, sizeof(struct pipeline_spec));
 	if (!s) {
 		if (err_line)
 			*err_line = n_lines;
@@ -4145,7 +4145,7 @@ pipeline_iospec_parse(FILE *spec,
 	}
 
 	/* Memory allocation. */
-	s = calloc(sizeof(struct pipeline_iospec), 1);
+	s = calloc(1, sizeof(struct pipeline_iospec));
 	if (!s) {
 		if (err_line)
 			*err_line = n_lines;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-07 01:05:37.985134560 +0000
+++ 0035-pipeline-fix-calloc-parameters.patch	2024-03-07 01:05:34.746938913 +0000
@@ -1 +1 @@
-From 0594ae0c42773d62aff870df25e73394f7f0a5a5 Mon Sep 17 00:00:00 2001
+From eb18df799b665566066f305efd3ddf0b2f113da2 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 0594ae0c42773d62aff870df25e73394f7f0a5a5 ]
+
@@ -33 +34,0 @@
-Cc: stable at dpdk.org
@@ -43 +44 @@
-index 2bba0d0524..17419e7b85 100644
+index 9116f38ed2..833436b831 100644
@@ -46 +47 @@
-@@ -2890,7 +2890,7 @@ pipeline_spec_parse(FILE *spec,
+@@ -2841,7 +2841,7 @@ pipeline_spec_parse(FILE *spec,
@@ -55 +56 @@
-@@ -4241,7 +4241,7 @@ pipeline_iospec_parse(FILE *spec,
+@@ -4145,7 +4145,7 @@ pipeline_iospec_parse(FILE *spec,


More information about the stable mailing list