mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02: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:
parent
8c966a10eb
commit
61718206ee
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user