net/mlx5: fix check of RSS queue index
[dpdk.git] / drivers / net / mlx5 / mlx5_flow.c
index 092f7b4..14a89e2 100644 (file)
@@ -1151,6 +1151,11 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
                                          RTE_FLOW_ERROR_TYPE_ACTION_CONF,
                                          NULL, "No queues configured");
        for (i = 0; i != rss->queue_num; ++i) {
+               if (rss->queue[i] >= priv->rxqs_n)
+                       return rte_flow_error_set
+                               (error, EINVAL,
+                                RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+                                &rss->queue[i], "queue index out of range");
                if (!(*priv->rxqs)[rss->queue[i]])
                        return rte_flow_error_set
                                (error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_CONF,