developer | ebda901 | 2024-02-22 13:42:45 +0800 | [diff] [blame^] | 1 | From 63d8c717443332fe21313e30e2301c5c9d8a4eb9 Mon Sep 17 00:00:00 2001 |
developer | d243af0 | 2023-12-21 14:49:33 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Thu, 26 Oct 2023 17:27:43 +0800 |
developer | ebda901 | 2024-02-22 13:42:45 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 2010/2032] mtk: wifi: mt76: mt7996: do not report netdev stats |
developer | d243af0 | 2023-12-21 14:49:33 +0800 | [diff] [blame] | 5 | on monitor vif |
| 6 | |
| 7 | This 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 | |
| 16 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 17 | --- |
| 18 | mt7996/mcu.c | 3 +++ |
| 19 | 1 file changed, 3 insertions(+) |
| 20 | |
| 21 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
developer | ebda901 | 2024-02-22 13:42:45 +0800 | [diff] [blame^] | 22 | index 5d19d6fc..ea22aa41 100644 |
developer | d243af0 | 2023-12-21 14:49:33 +0800 | [diff] [blame] | 23 | --- a/mt7996/mcu.c |
| 24 | +++ b/mt7996/mcu.c |
| 25 | @@ -537,6 +537,9 @@ static inline void __mt7996_stat_to_netdev(struct mt76_phy *mphy, |
| 26 | drv_priv); |
| 27 | wdev = ieee80211_vif_to_wdev(vif); |
| 28 | |
| 29 | + if (vif->type == NL80211_IFTYPE_MONITOR) |
| 30 | + return; |
| 31 | + |
| 32 | dev_sw_netstats_tx_add(wdev->netdev, tx_packets, tx_bytes); |
| 33 | dev_sw_netstats_rx_add(wdev->netdev, rx_packets, rx_bytes); |
| 34 | } |
| 35 | -- |
| 36 | 2.18.0 |
| 37 | |