[dpdk-dev,v3,13/14] net/mlx5: fix invalid flow item check

Message ID 20180413112023.106420-14-xuemingl@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Shahaf Shuler
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

Xueming Li April 13, 2018, 11:20 a.m. UTC
  This patch fixed invalid flow item check.

Fixes: 4f1a88e3f9b0 ("net/mlx5: standardize on negative errno values")
Cc: nelio.laranjeiro@6wind.com

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Nélio Laranjeiro April 13, 2018, 1:40 p.m. UTC | #1
On Fri, Apr 13, 2018 at 07:20:22PM +0800, Xueming Li wrote:
> This patch fixed invalid flow item check.
> 
> Fixes: 4f1a88e3f9b0 ("net/mlx5: standardize on negative errno values")
> Cc: nelio.laranjeiro@6wind.com
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>

Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

> ---
>  drivers/net/mlx5/mlx5_flow.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 98edf1882..d36b6ed8a 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -935,8 +935,10 @@ mlx5_flow_convert_items_validate(struct rte_eth_dev *dev,
>  				break;
>  			}
>  		}
> -		if (!token)
> +		if (!token) {
> +			ret = -ENOTSUP;
>  			goto exit_item_not_supported;
> +		}
>  		cur_item = token;
>  		ret = mlx5_flow_item_validate(items,
>  					      (const uint8_t *)cur_item->mask,
> -- 
> 2.13.3
 
Should be proposed outside of this series.

Thanks,
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 98edf1882..d36b6ed8a 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -935,8 +935,10 @@  mlx5_flow_convert_items_validate(struct rte_eth_dev *dev,
 				break;
 			}
 		}
-		if (!token)
+		if (!token) {
+			ret = -ENOTSUP;
 			goto exit_item_not_supported;
+		}
 		cur_item = token;
 		ret = mlx5_flow_item_validate(items,
 					      (const uint8_t *)cur_item->mask,