pipeline: fix selector freeing
authorCristian Dumitrescu <cristian.dumitrescu@intel.com>
Mon, 12 Jul 2021 18:18:32 +0000 (19:18 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 21 Jul 2021 11:51:17 +0000 (13:51 +0200)
Due to a typo, the selector_free() function incorrectly takes an early
return when the selectors array is non-NULL, as opposed to the other
way around.

Coverity issue: 371912
Fixes: cdaa937d3eaab ("pipeline: support selector table")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
lib/pipeline/rte_swx_ctl.c

index f1480bc..dc09386 100644 (file)
@@ -815,7 +815,7 @@ selector_free(struct rte_swx_ctl_pipeline *ctl)
 {
        uint32_t i;
 
-       if (ctl->selectors)
+       if (!ctl->selectors)
                return;
 
        for (i = 0; i < ctl->info.n_selectors; i++) {