[1/2] pipeline: fix incorrect resource free function

Message ID 20210712181833.15293-1-cristian.dumitrescu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] pipeline: fix incorrect resource free function |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Cristian Dumitrescu July 12, 2021, 6:18 p.m. UTC
  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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/lib/pipeline/rte_swx_ctl.c b/lib/pipeline/rte_swx_ctl.c
index f1480bc27b..dc093860de 100644
--- a/lib/pipeline/rte_swx_ctl.c
+++ b/lib/pipeline/rte_swx_ctl.c
@@ -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++) {