After checking the RSS, distribution and IPsec crypto parser lists,
iavf_flow_process_filter() returns success as soon as it finds an
engine. If all three searches fail, *engine is NULL, so the final
return 0 is unreachable and the preceding NULL check is redundant.

Report the error unconditionally after the searches and remove the
unreachable success return. No functional change.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Cc: [email protected]

Signed-off-by: Artem Novikov <[email protected]>
---
Cc: Radu Nicolau <[email protected]>

 drivers/net/intel/iavf/iavf_generic_flow.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/intel/iavf/iavf_generic_flow.c 
b/drivers/net/intel/iavf/iavf_generic_flow.c
index 
9608ec59b1840d40be98717833ea4e8edfa98277..a5f19ccda3452101dccb284c566559be8bb8b1a0
 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.c
+++ b/drivers/net/intel/iavf/iavf_generic_flow.c
@@ -2199,14 +2199,10 @@ iavf_flow_process_filter(struct rte_eth_dev *dev,
        if (*engine)
                return 0;
 
-       if (!*engine) {
-               rte_flow_error_set(error, EINVAL,
-                                  RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
-                                  "Failed to create parser engine.");
-               return -rte_errno;
-       }
-
-       return 0;
+       rte_flow_error_set(error, EINVAL,
+                          RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+                          "Failed to create parser engine.");
+       return -rte_errno;
 }
 
 static int

Reply via email to