Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+3 -2
+3 -2
drivers/net/ethernet/mellanox/mlx5/core/eq.c
··· 1070 1070 1071 1071 list_for_each_entry(eq, &table->comp_eqs_list, list) { 1072 1072 if (i++ == vector) 1073 - break; 1073 + return mlx5_irq_get_affinity_mask(eq->core.irq); 1074 1074 } 1075 1075 1076 - return mlx5_irq_get_affinity_mask(eq->core.irq); 1076 + WARN_ON_ONCE(1); 1077 + return NULL; 1077 1078 } 1078 1079 EXPORT_SYMBOL(mlx5_comp_irq_get_affinity_mask); 1079 1080