From: Maayan Kashani <mkashani@nvidia.com>
To: <dev@dpdk.org>
Cc: <mkashani@nvidia.com>, <dsosnowski@nvidia.com>,
<rasland@nvidia.com>, <stable@dpdk.org>,
Ori Kam <orika@nvidia.com>, Thomas Monjalon <thomas@monjalon.net>,
Ferruh Yigit <ferruh.yigit@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Alexander Kozyrev <akozyrev@nvidia.com>
Subject: [PATCH] ethdev: fix null error struct in flow configure
Date: Thu, 29 May 2025 08:56:10 +0300 [thread overview]
Message-ID: <20250529055612.115265-1-mkashani@nvidia.com> (raw)
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
reply other threads:[~2025-05-29 5:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250529055612.115265-1-mkashani@nvidia.com \
--to=mkashani@nvidia.com \
--cc=akozyrev@nvidia.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=ferruh.yigit@amd.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).