RTE flow configure returned error value w/o filling the
error struct which caused a crash on complain function.

Filling the error struct fixed the issue.

Signed-off-by: Maayan Kashani <mkash...@nvidia.com>
Fixes: 4ff58b734bc9 ("ethdev: introduce flow engine configuration")
Cc: sta...@dpdk.org
---
 lib/ethdev/rte_flow.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 9f8d8f3dc2d..fe8f43caff7 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -1725,21 +1725,21 @@ rte_flow_configure(uint16_t port_id,
                FLOW_LOG(INFO,
                        "Device with port_id=%"PRIu16" is not configured.",
                        port_id);
-               return -EINVAL;
+               goto error;
        }
        if (dev->data->dev_started != 0) {
                FLOW_LOG(INFO,
                        "Device with port_id=%"PRIu16" already started.",
                        port_id);
-               return -EINVAL;
+               goto error;
        }
        if (port_attr == NULL) {
                FLOW_LOG(ERR, "Port %"PRIu16" info is NULL.", port_id);
-               return -EINVAL;
+               goto error;
        }
        if (queue_attr == NULL) {
                FLOW_LOG(ERR, "Port %"PRIu16" queue info is NULL.", port_id);
-               return -EINVAL;
+               goto error;
        }
        if ((port_attr->flags & RTE_FLOW_PORT_FLAG_SHARE_INDIRECT) &&
             !rte_eth_dev_is_valid_port(port_attr->host_port_id)) {
@@ -1760,6 +1760,10 @@ rte_flow_configure(uint16_t port_id,
        return rte_flow_error_set(error, ENOTSUP,
                                  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
                                  NULL, rte_strerror(ENOTSUP));
+error:
+       return rte_flow_error_set(error, EINVAL,
+                                 RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+                                 NULL, rte_strerror(EINVAL));
 }
 
 RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_flow_pattern_template_create, 22.03)
-- 
2.21.0

Reply via email to