pipeline: fix instruction label check
authorYogesh Jangra <yogesh.jangra@intel.com>
Thu, 21 Oct 2021 03:23:32 +0000 (23:23 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 25 Oct 2021 12:06:02 +0000 (14:06 +0200)
The instruction_data array was incorrectly indexed, which resulted in
the array index getting out of bounds and sometimes segfault.

Fixes: a1711f (“pipeline: add SWX Rx and extract instructions“)
Cc: stable@dpdk.org
Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
lib/pipeline/rte_swx_pipeline.c

index 1cd09a4..0550560 100644 (file)
@@ -5983,7 +5983,7 @@ instr_label_check(struct instruction_data *instruction_data,
                        continue;
 
                for (j = i + 1; j < n_instructions; j++)
-                       CHECK(strcmp(label, data[j].label), EINVAL);
+                       CHECK(strcmp(label, instruction_data[j].label), EINVAL);
        }
 
        /* Get users for each instruction label. */