eth: mlx5: avoid iterator use outside of a loop
Subsystems (3)
Jakub Kicinski
maintainerPATCH 1/1 eth: mlx5: avoid iterator use outside of a loop
Fix the following warning about risky iterator use:
drivers/net/ethernet/mellanox/mlx5/core/eq.c:1010 mlx5_comp_irq_get_affinity_mask() warn: iterator used outside loop: 'eq'
---
v2:
- return NULL rather than 0
v1: https://lore.kernel.org/all/20230416101753.GB15386@unreal/
--- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/eq.c +3 -2
@@ -1070,10 +1070,11 @@ mlx5_comp_irq_get_affinity_mask(struct mlx5_core_dev *dev, int vector)list_for_each_entry (eq, &table->comp_eqs_list, list) {if (i++ == vector) -break ; +return mlx5_irq_get_affinity_mask (eq->core.irq); } -return mlx5_irq_get_affinity_mask (eq->core.irq); +WARN_ON_ONCE (1 ); +return NULL ; }EXPORT_SYMBOL (mlx5_comp_irq_get_affinity_mask);
Signature · 1 line
2.39.2
Quoted 4 lines · Jakub Kicinski
Fix the following warning about risky iterator use:
drivers/net/ethernet/mellanox/mlx5/core/eq.c:1010mlx5_comp_irq_get_affinity_mask()warn: iterator used outside loop: 'eq'
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Wed, 19 Apr 2023 18:58:02 -0700 you wrote:
Fix the following warning about risky iterator use:
drivers/net/ethernet/mellanox/mlx5/core/eq.c:1010mlx5_comp_irq_get_affinity_mask()warn: iterator used outside loop: 'eq'Signed-off-by Jakub Kicinski <[email protected]>---
v2:
- return NULL rather than 0
v1: https://lore.kernel.org/all/20230416101753.GB15386@unreal/[...]
Here is the summary with links:
- [net-next] eth: mlx5: avoid iterator use outside of a loop
https://git.kernel.org/netdev/net-next/c/61718206ee5d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html