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 committed by David S. Miller
parent 7aab5159fa
commit cae0633872
1 changed files with 1 additions and 1 deletions

View File

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