[PATCH] ethdev: fix flow action async query coverity

Suanming Mou suanmingm at nvidia.com
Tue Oct 17 10:23:17 CEST 2023


This commit adds the ops chcek to fix the coverity issue.

Coverity issue: 403258
Fixes: c9dc03840873 ("ethdev: add indirect action async query")

Signed-off-by: Suanming Mou <suanmingm at nvidia.com>
---
 lib/ethdev/rte_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 874f845513..3a67f1aaba 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -2226,6 +2226,8 @@ rte_flow_async_action_handle_query(uint16_t port_id,
 	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
 	int ret;
 
+	if (unlikely(!ops))
+		return -rte_errno;
 	ret = ops->async_action_handle_query(dev, queue_id, op_attr,
 					  action_handle, data, user_data, error);
 	ret = flow_err(port_id, ret, error);
-- 
2.34.1



More information about the dev mailing list