[dpdk-dev] [PATCH] app/test-crypto-perf: fix incorrect size of expression

Jacek Piasecki jacekx.piasecki at intel.com
Wed Feb 8 17:04:41 CET 2017


Fix problem of passing a pointer to sizeof() function. Now the size
of enabled_cdevs structure is passed by RTE_CRYPTO_MAX_DEVS.

Coverity issue: 141068
Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Jacek Piasecki <jacekx.piasecki at intel.com>
---
 app/test-crypto-perf/main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 634ea5f..dff906e 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -39,13 +39,14 @@
 };
 
 static int
-cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs)
+cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs,
+		uint8_t enabled_cdevs_dim)
 {
 	uint8_t cdev_id, enabled_cdev_count = 0, nb_lcores;
 	int ret;
 
 	enabled_cdev_count = rte_cryptodev_devices_get(opts->device_type,
-			enabled_cdevs, RTE_DIM(enabled_cdevs));
+			enabled_cdevs, enabled_cdevs_dim);
 	if (enabled_cdev_count == 0) {
 		printf("No crypto devices type %s available\n",
 				opts->device_type);
@@ -296,7 +297,8 @@
 	if (!opts.silent)
 		cperf_options_dump(&opts);
 
-	nb_cryptodevs = cperf_initialize_cryptodev(&opts, enabled_cdevs);
+	nb_cryptodevs = cperf_initialize_cryptodev(&opts, enabled_cdevs,
+			RTE_CRYPTO_MAX_DEVS);
 	if (nb_cryptodevs < 1) {
 		RTE_LOG(ERR, USER1, "Failed to initialise requested crypto "
 				"device type\n");
-- 
1.9.1

--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.



More information about the dev mailing list