Commit 61718206 authored by Jakub Kicinski's avatar Jakub Kicinski

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: default avatarSaeed Mahameed <saeed@kernel.org>
Link: https://lore.kernel.org/r/20230420015802.815362-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8c966a10
...@@ -1070,10 +1070,11 @@ mlx5_comp_irq_get_affinity_mask(struct mlx5_core_dev *dev, int vector) ...@@ -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) { list_for_each_entry(eq, &table->comp_eqs_list, list) {
if (i++ == vector) 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); EXPORT_SYMBOL(mlx5_comp_irq_get_affinity_mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment