From 09c2b39b22397272668e49060e5f3e3b50fd40b4 Mon Sep 17 00:00:00 2001
From: zhengjiebing <zhengjiebing_yewu@cmss.chinamobile.com>
Date: Fri, 20 Oct 2023 09:52:11 +0800
Subject: [PATCH] delete_rule bug

---
 src/lstack/netif/lstack_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lstack/netif/lstack_ethdev.c b/src/lstack/netif/lstack_ethdev.c
index 30c3c9a..6e4c9de 100644
--- a/src/lstack/netif/lstack_ethdev.c
+++ b/src/lstack/netif/lstack_ethdev.c
@@ -189,7 +189,7 @@ void delete_rule(char* rule_key)
 {
     struct flow_rule *rule = NULL;
     HASH_FIND_STR(g_flow_rules, rule_key, rule);
-    if (rule == NULL) {
+    if (rule != NULL) {
         HASH_DEL(g_flow_rules, rule);
         free(rule);
     }
-- 
2.27.0

