diff mbox series

[09/10] mt76: mt7915: do not overwrite all mib counters in mt7915_get_stats

Message ID adbdc6fae15ed6b62a97532e36ec6af16b2ed84e.1634558817.git.lorenzo@kernel.org (mailing list archive)
State Changes Requested
Delegated to: Felix Fietkau
Headers show
Series mt76: ethtool stats features and fixes | expand

Commit Message

Lorenzo Bianconi Oct. 18, 2021, 12:14 p.m. UTC
Do not overwrite all mib counters in mt7915_get_stats since they are
used for ethtool stats.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
index 13ef56205c98..b5b23c824233 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -816,7 +816,7 @@  mt7915_get_stats(struct ieee80211_hw *hw,
 	stats->dot11FCSErrorCount = mib->fcs_err_cnt;
 	stats->dot11ACKFailureCount = mib->ack_fail_cnt;
 
-	memset(mib, 0, sizeof(*mib));
+	memset(mib, 0, offsetof(struct mib_stats, ba_miss_cnt));
 
 	mutex_unlock(&dev->mt76.mutex);