From: NĂ©lio Laranjeiro Date: Tue, 31 Jan 2017 16:02:47 +0000 (+0100) Subject: net/mlx5: fix verification of mark action X-Git-Tag: spdx-start~4561 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6194f53bb3c5d3953cdf24a15a02598212b04dd6;p=dpdk.git net/mlx5: fix verification of mark action A configuration structure for the MARK action must always be specified. Fixes: ea3bc3b1df94 ("net/mlx5: support mark flow action") Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 4917f79e0e..34ac5d3803 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -457,7 +457,13 @@ priv_flow_validate(struct priv *priv, (const struct rte_flow_action_mark *) actions->conf; - if (mark && (mark->id >= MLX5_FLOW_MARK_MAX)) { + if (!mark) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, + actions, + "mark must be defined"); + return -rte_errno; + } else if (mark->id >= MLX5_FLOW_MARK_MAX) { rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, actions,