net/mlx5: fix empty RSS flow action
authorNélio Laranjeiro <nelio.laranjeiro@6wind.com>
Tue, 18 Apr 2017 08:30:11 +0000 (10:30 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 19 Apr 2017 13:37:37 +0000 (15:37 +0200)
Empty RSS action is causing a segmentation fault.

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

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
drivers/net/mlx5/mlx5_flow.c

index 8d62f85..1784e64 100644 (file)
@@ -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;