[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200504.104251.870707696930385118.davem@davemloft.net>
Date: Mon, 04 May 2020 10:42:51 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: tariqt@...lanox.com
Cc: netdev@...r.kernel.org, moshe@...lanox.com, jgg@...lanox.com
Subject: Re: [PATCH net] net/mlx4_core: Fix use of ENOSPC around
mlx4_counter_alloc()
From: Tariq Toukan <tariqt@...lanox.com>
Date: Mon, 4 May 2020 11:36:02 +0300
> When ENOSPC is set the idx is still valid and gets set to the global
> MLX4_SINK_COUNTER_INDEX. However gcc's static analysis cannot tell that
> ENOSPC is impossible from mlx4_cmd_imm() and gives this warning:
>
> drivers/net/ethernet/mellanox/mlx4/main.c:2552:28: warning: 'idx' may be
> used uninitialized in this function [-Wmaybe-uninitialized]
> 2552 | priv->def_counter[port] = idx;
>
> Also, when ENOSPC is returned mlx4_allocate_default_counters should not
> fail.
>
> Fixes: 6de5f7f6a1fa ("net/mlx4_core: Allocate default counter per port")
> Signed-off-by: Jason Gunthorpe <jgg@...lanox.com>
> Signed-off-by: Tariq Toukan <tariqt@...lanox.com>
Applied, thank you.
Powered by blists - more mailing lists