net/mlx4_en: Fix off-by-one in counters manipulation
This caused the en_stats_adder helper to accumulate a field which is
not related to the counter, fix that.
Fixes: a3333b35da
('net/mlx4_en: Moderate ethtool callback to show [..]')
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
7aab5159fa
Коммит
cae0633872
|
@ -139,7 +139,7 @@ static unsigned long en_stats_adder(__be64 *start, __be64 *next, int num)
|
|||
int i;
|
||||
int offset = next - start;
|
||||
|
||||
for (i = 0; i <= num; i++) {
|
||||
for (i = 0; i < num; i++) {
|
||||
ret += be64_to_cpu(*curr);
|
||||
curr += offset;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче