app/crypto-perf: fix out-of-bounds array access
authorFan Zhang <roy.fan.zhang@intel.com>
Tue, 23 Jan 2018 14:22:55 +0000 (14:22 +0000)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Mon, 29 Jan 2018 19:22:33 +0000 (20:22 +0100)
Fixes: 27c2e7471961 ("app/crypto-perf: support IMIX")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
app/test-crypto-perf/main.c

index 83a9d7b..019d835 100644 (file)
@@ -579,19 +579,17 @@ main(int argc, char **argv)
                        i = 0;
                        RTE_LCORE_FOREACH_SLAVE(lcore_id) {
 
-                               if (i == nb_cryptodevs)
+                               if (i == total_nb_qps)
                                        break;
 
-                               cdev_id = enabled_cdevs[i];
-
                                rte_eal_remote_launch(cperf_testmap[opts.test].runner,
-                                       ctx[cdev_id], lcore_id);
+                                       ctx[i], lcore_id);
                                i++;
                        }
                        i = 0;
                        RTE_LCORE_FOREACH_SLAVE(lcore_id) {
 
-                               if (i == nb_cryptodevs)
+                               if (i == total_nb_qps)
                                        break;
                                rte_eal_wait_lcore(lcore_id);
                                i++;
@@ -634,8 +632,6 @@ err:
                if (i == total_nb_qps)
                        break;
 
-               cdev_id = enabled_cdevs[i];
-
                if (ctx[i] && cperf_testmap[opts.test].destructor)
                        cperf_testmap[opts.test].destructor(ctx[i]);
                i++;