lkml.org 
[lkml]   [2021]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: ethernet: mellanox: return errno instead of 1
From
Date
On Wed, 2021-12-22 at 18:24 -0800, Qing Wang wrote:
> From: Wang Qing <wangqing@vivo.com>
>
> mlx5e_hv_vhca_stats_create() better return specific error than 1
>
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
> b/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
> index d290d72..04cda3d
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/hv_vhca_stats.c
> @@ -142,7 +142,7 @@ int mlx5e_hv_vhca_stats_create(struct mlx5e_priv
> *priv)
>                                     PTR_ERR(agent));
>  
>                 kvfree(priv->stats_agent.buf);
> -               return IS_ERR_OR_NULL(agent);
> +               return agent ? PTR_ERR(agent) : -ENODEV;

the single caller of this function ignores the return value,
I just made a patch to void the return value and added you as Reported-
by.

Thanks !


\
 
 \ /
  Last update: 2021-12-23 20:35    [W:0.038 / U:1.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site