blob: 7cede7af16874d17bd9c26fcdcc01908105645d5 [file] [log] [blame]
developerd0c89452024-10-11 16:53:27 +08001From 4fa8ea3f212978e36a7b9489505545f655d7e3e1 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Thu, 26 Oct 2023 17:27:43 +0800
developerd0c89452024-10-11 16:53:27 +08004Subject: [PATCH 059/223] mtk: mt76: mt7996: do not report netdev stats on
developer05f3b2b2024-08-19 19:17:34 +08005 monitor vif
developer66e89bc2024-04-23 14:50:01 +08006
7This fixes the following NULL pointer crash when enabling monitor mode:
8[ 205.593158] Call trace:
9[ 205.595597] mt7996_mcu_rx_event+0x4a0/0x6e8 [mt7996e]
10[ 205.600725] mt7996_queue_rx_skb+0x6e4/0xfa0 [mt7996e]
11[ 205.605851] mt76_dma_rx_poll+0x384/0x420 [mt76]
12[ 205.610459] __napi_poll+0x38/0x1c0
13[ 205.613935] napi_threaded_poll+0x80/0xe8
14[ 205.617934] kthread+0x124/0x128
15
developerd0c89452024-10-11 16:53:27 +080016Change-Id: I66f2449401888255bf8d3edddc1d9f20bd8ba3e7
developer66e89bc2024-04-23 14:50:01 +080017Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
18---
19 mt7996/mcu.c | 3 +++
20 1 file changed, 3 insertions(+)
21
22diff --git a/mt7996/mcu.c b/mt7996/mcu.c
developerd0c89452024-10-11 16:53:27 +080023index 8b84c9dc..6b7a5372 100644
developer66e89bc2024-04-23 14:50:01 +080024--- a/mt7996/mcu.c
25+++ b/mt7996/mcu.c
developerd0c89452024-10-11 16:53:27 +080026@@ -545,6 +545,9 @@ static inline void __mt7996_stat_to_netdev(struct mt76_phy *mphy,
developer66e89bc2024-04-23 14:50:01 +080027 drv_priv);
28 wdev = ieee80211_vif_to_wdev(vif);
29
30+ if (vif->type == NL80211_IFTYPE_MONITOR)
31+ return;
32+
33 dev_sw_netstats_tx_add(wdev->netdev, tx_packets, tx_bytes);
34 dev_sw_netstats_rx_add(wdev->netdev, rx_packets, rx_bytes);
35 }
36--
developerd0c89452024-10-11 16:53:27 +0800372.45.2
developer66e89bc2024-04-23 14:50:01 +080038