summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEran Ben Elisha <eranbe@mellanox.com>2015-05-05 14:07:11 (GMT)
committerDavid S. Miller <davem@davemloft.net>2015-05-05 23:39:12 (GMT)
commitcae0633872fc8b0c34930dd2862856563bce58ec (patch)
treea618dd534721f5f7539a4c14facdd714752589e7
parent7aab5159fa0100ee3f80d1b0f55cd7e9b5823270 (diff)
downloadlinux-cae0633872fc8b0c34930dd2862856563bce58ec.tar.xz
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: a3333b35da16 ('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>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_port.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_port.c b/drivers/net/ethernet/mellanox/mlx4/en_port.c
index 54f0e5a..0a56f01 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_port.c
@@ -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;
}