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:
Eran Ben Elisha 2015-05-05 17:07:11 +03:00 коммит произвёл David S. Miller
Родитель 7aab5159fa
Коммит cae0633872
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;
}