From 1e1d4fb791097c9cca687c3ee3f56284e2be2c25 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 11 Apr 2017 15:42:59 +0100 Subject: [PATCH] app/crypto-perf: fix possible overflow In the latency test, when number of enqueued operations is less than the burst size, the timestamp value of the non-enqueued operations was being stored, even though those operations were being freed. This could cause an array overflow, since it could store more values than the total number of operations. Fixes: 5d75fb09d3be ("app/crypto-perf: fix invalid latency for QAT") Cc: stable@dpdk.org Signed-off-by: Pablo de Lara --- app/test-crypto-perf/cperf_test_latency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index 3275b4b640..e61ac97282 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -396,7 +396,7 @@ cperf_latency_test_runner(void *arg) for (i = ops_enqd; i < burst_size; i++) rte_crypto_op_free(ops[i]); - for (i = 0; i < burst_size; i++) { + for (i = 0; i < ops_enqd; i++) { ctx->res[tsc_idx].tsc_start = tsc_start; ops[i]->opaque_data = (void *)&ctx->res[tsc_idx]; tsc_idx++; -- 2.20.1