[PATCH net-next] net/mlx5: HWS, Fix an error code in mlx5hws_bwc_rule_create_complex()

Dan Carpenter posted 1 patch 6 months, 3 weeks ago
.../net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c  | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH net-next] net/mlx5: HWS, Fix an error code in mlx5hws_bwc_rule_create_complex()
Posted by Dan Carpenter 6 months, 3 weeks ago
This was intended to be negative -ENOMEM but the '-' character was left
off accidentally.  This typo doesn't affect runtime because the caller
treats all non-zero returns the same.

Fixes: 17e0accac577 ("net/mlx5: HWS, support complex matchers")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 .../net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c
index 5d30c5b094fc..70768953a4f6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c
@@ -1188,7 +1188,7 @@ int mlx5hws_bwc_rule_create_complex(struct mlx5hws_bwc_rule *bwc_rule,
 			      GFP_KERNEL);
 	if (unlikely(!match_buf_2)) {
 		mlx5hws_err(ctx, "Complex rule: failed allocating match_buf\n");
-		ret = ENOMEM;
+		ret = -ENOMEM;
 		goto hash_node_put;
 	}
 
-- 
2.47.2
Re: [PATCH net-next] net/mlx5: HWS, Fix an error code in mlx5hws_bwc_rule_create_complex()
Posted by Tariq Toukan 6 months, 3 weeks ago

On 23/05/2025 19:00, Dan Carpenter wrote:
> This was intended to be negative -ENOMEM but the '-' character was left
> off accidentally.  This typo doesn't affect runtime because the caller
> treats all non-zero returns the same.
> 
> Fixes: 17e0accac577 ("net/mlx5: HWS, support complex matchers")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>   .../net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c  | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c
> index 5d30c5b094fc..70768953a4f6 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c
> @@ -1188,7 +1188,7 @@ int mlx5hws_bwc_rule_create_complex(struct mlx5hws_bwc_rule *bwc_rule,
>   			      GFP_KERNEL);
>   	if (unlikely(!match_buf_2)) {
>   		mlx5hws_err(ctx, "Complex rule: failed allocating match_buf\n");
> -		ret = ENOMEM;
> +		ret = -ENOMEM;
>   		goto hash_node_put;
>   	}
>   

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Re: [PATCH net-next] net/mlx5: HWS, Fix an error code in mlx5hws_bwc_rule_create_complex()
Posted by Yevgeny Kliteynik 6 months, 3 weeks ago
On 23-May-25 19:00, Dan Carpenter wrote:
> This was intended to be negative -ENOMEM but the '-' character was left
> off accidentally.  This typo doesn't affect runtime because the caller
> treats all non-zero returns the same.
> 
> Fixes: 17e0accac577 ("net/mlx5: HWS, support complex matchers")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>   .../net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c  | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c
> index 5d30c5b094fc..70768953a4f6 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc_complex.c
> @@ -1188,7 +1188,7 @@ int mlx5hws_bwc_rule_create_complex(struct mlx5hws_bwc_rule *bwc_rule,
>   			      GFP_KERNEL);
>   	if (unlikely(!match_buf_2)) {
>   		mlx5hws_err(ctx, "Complex rule: failed allocating match_buf\n");
> -		ret = ENOMEM;
> +		ret = -ENOMEM;
>   		goto hash_node_put;
>   	}
>   

Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com>

Thanks Dan.