From 30788c5510356b8dd6870a30aa616d9ee043c154 Mon Sep 17 00:00:00 2001 From: =?utf8?q?N=C3=A9lio=20Laranjeiro?= Date: Tue, 18 Apr 2017 10:30:11 +0200 Subject: [PATCH] net/mlx5: fix empty RSS flow action Empty RSS action is causing a segmentation fault. Fixes: 3d821d6fea40 ("net/mlx5: support RSS action flow rule") Signed-off-by: Nelio Laranjeiro Acked-by: Shahaf Shuler Acked-by: Adrien Mazarguil --- 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 8d62f85e13..1784e64fa9 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.20.1