DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jacek Piasecki <jacekx.piasecki@intel.com>
To: declan.doherty@intel.com
Cc: dev@dpdk.org, Jacek Piasecki <jacekx.piasecki@intel.com>
Subject: [dpdk-dev] [PATCH] app/test-crypto-perf: fix incorrect size of expression
Date: Wed,  8 Feb 2017 17:04:41 +0100	[thread overview]
Message-ID: <1486569881-16220-2-git-send-email-jacekx.piasecki@intel.com> (raw)
In-Reply-To: <1486569881-16220-1-git-send-email-jacekx.piasecki@intel.com>

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

  reply	other threads:[~2017-02-08 14:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 16:04 [dpdk-dev] [PATCH] app/test-crypto-perf: fix big paremeter passed by value Jacek Piasecki
2017-02-08 16:04 ` Jacek Piasecki [this message]
2017-02-09 23:53   ` [dpdk-dev] [PATCH] app/test-crypto-perf: fix incorrect size of expression De Lara Guarch, Pablo
2017-02-10 13:26   ` [dpdk-dev] [PATCH v2] " Jacek Piasecki
2017-02-10 11:28     ` De Lara Guarch, Pablo
2017-02-10 11:48       ` De Lara Guarch, Pablo
2017-02-09 23:41 ` [dpdk-dev] [PATCH] app/test-crypto-perf: fix big paremeter passed by value De Lara Guarch, Pablo
2017-02-09 23:48   ` De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486569881-16220-2-git-send-email-jacekx.piasecki@intel.com \
    --to=jacekx.piasecki@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).