From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 9E23FDE0 for ; Wed, 8 Feb 2017 15:09:15 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 08 Feb 2017 06:09:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="41488986" Received: from gklab-246-019.igk.intel.com (HELO intel.com) ([10.217.246.19]) by orsmga002.jf.intel.com with SMTP; 08 Feb 2017 06:09:12 -0800 Received: by intel.com (sSMTP sendmail emulation); Wed, 08 Feb 2017 17:11:15 +0100 From: Jacek Piasecki To: declan.doherty@intel.com Cc: dev@dpdk.org, Jacek Piasecki Date: Wed, 8 Feb 2017 17:04:41 +0100 Message-Id: <1486569881-16220-2-git-send-email-jacekx.piasecki@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486569881-16220-1-git-send-email-jacekx.piasecki@intel.com> References: <1486569881-16220-1-git-send-email-jacekx.piasecki@intel.com> Subject: [dpdk-dev] [PATCH] app/test-crypto-perf: fix incorrect size of expression X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2017 14:09:16 -0000 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 --- 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.