* [PATCH] ethdev: fix null error struct in flow configure
@ 2025-05-29 5:56 Maayan Kashani
0 siblings, 0 replies; only message in thread
From: Maayan Kashani @ 2025-05-29 5:56 UTC (permalink / raw)
To: dev
Cc: mkashani, dsosnowski, rasland, stable, Ori Kam, Thomas Monjalon,
Ferruh Yigit, Andrew Rybchenko, Alexander Kozyrev
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 <mkashani@nvidia.com>
Fixes: 4ff58b734bc9 ("ethdev: introduce flow engine configuration")
Cc: stable@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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-29 5:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-29 5:56 [PATCH] ethdev: fix null error struct in flow configure Maayan Kashani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).