summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTariq Toukan <tariqt@mellanox.com>2020-05-04 11:36:02 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-20 08:11:29 +0200
commit96a1e05f7b21e50c887336ac6ae249bdf62dfaed (patch)
tree504ce818dca24f5be57621a2f897510bc3b21ba7 /scripts
parent405a8cc9b4ed889990d014538607a9c5752b06d2 (diff)
net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc()
[ Upstream commit 40e473071dbad04316ddc3613c3a3d1c75458299 ] 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@mellanox.com> Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions