patch 'dmadev: fix calloc parameters' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:46:25 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

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/31/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ad881b0db859fe2e4762ab2313a8e2fd4881894f

Thanks.

Xueming Li <xuemingl at nvidia.com>

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

[ upstream commit 905f8335f916aed1f3119e35332a32119dea4510 ]

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

[1]
gcc (GCC) 14.0.1 20240124 (experimental)

[2]
Compiling C object lib/librte_dmadev.a.p/dmadev_rte_dmadev.c.o
../lib/dmadev/rte_dmadev.c: In function ‘dmadev_handle_dev_dump’:
../lib/dmadev/rte_dmadev.c:1033:29:
  warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
  argument and not in the later argument [-Wcalloc-transposed-args]
 1033 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
      |                         ^~~~

Fixes: 94043b04212a ("dmadev: support telemetry dump dmadev")

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>
---
 lib/dmadev/rte_dmadev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c
index 009a21849a..31a268cfdb 100644
--- a/lib/dmadev/rte_dmadev.c
+++ b/lib/dmadev/rte_dmadev.c
@@ -1028,7 +1028,7 @@ dmadev_handle_dev_dump(const char *cmd __rte_unused,
 	if (*end_param != '\0')
 		RTE_DMA_LOG(WARNING, "Extra parameters passed to dmadev telemetry command, ignoring");

-	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.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.350643745 +0800
+++ 0044-dmadev-fix-calloc-parameters.patch	2024-03-05 17:39:30.743566492 +0800
@@ -1 +1 @@
-From 905f8335f916aed1f3119e35332a32119dea4510 Mon Sep 17 00:00:00 2001
+From ad881b0db859fe2e4762ab2313a8e2fd4881894f Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 905f8335f916aed1f3119e35332a32119dea4510 ]
@@ -25 +27,0 @@
-Cc: stable at dpdk.org
@@ -35 +37 @@
-index 25c92ef8a8..e64b279bac 100644
+index 009a21849a..31a268cfdb 100644
@@ -38 +40 @@
-@@ -1040,7 +1040,7 @@ dmadev_handle_dev_dump(const char *cmd __rte_unused,
+@@ -1028,7 +1028,7 @@ dmadev_handle_dev_dump(const char *cmd __rte_unused,


More information about the stable mailing list