Empty RSS action is causing a segmentation fault.

Fixes: 3d821d6fea40 ("net/mlx5: support RSS action flow rule")

Signed-off-by: Nelio Laranjeiro <nelio.laranje...@6wind.com>
Acked-by: Shahaf Shuler <shah...@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarg...@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 8d62f85..1784e64 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -506,6 +506,13 @@ priv_flow_validate(struct priv *priv,
                                actions->conf;
                        uint16_t n;
 
+                       if (!rss || !rss->num) {
+                               rte_flow_error_set(error, EINVAL,
+                                                  RTE_FLOW_ERROR_TYPE_ACTION,
+                                                  actions,
+                                                  "no valid queues");
+                               return -rte_errno;
+                       }
                        if (action->queues_n == 1) {
                                uint16_t found = 0;
 
-- 
2.1.4

Reply via email to