mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-26 09:52:31 -04:00
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' Acked-by: Saeed Mahameed <saeed@kernel.org> Link: https://lore.kernel.org/r/20230420015802.815362-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user