developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From 8f1b477c5734b3e46dd8d6795c784ef58d553d74 Mon Sep 17 00:00:00 2001 |
| 2 | From: Bo Jiao <Bo.Jiao@mediatek.com> |
| 3 | Date: Thu, 27 Jun 2024 14:54:38 +0800 |
| 4 | Subject: [PATCH 168/199] mtk: mt76: mt7996: Fix NULL pointer crash when mac tx |
| 5 | free with a msta that has been removed. |
| 6 | |
| 7 | Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com> |
| 8 | --- |
| 9 | mt7996/mac.c | 2 +- |
| 10 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 11 | |
| 12 | diff --git a/mt7996/mac.c b/mt7996/mac.c |
| 13 | index 2f37d31c..12cc60cb 100644 |
| 14 | --- a/mt7996/mac.c |
| 15 | +++ b/mt7996/mac.c |
| 16 | @@ -1200,7 +1200,7 @@ mt7996_mac_tx_free(struct mt7996_dev *dev, void *data, int len) |
| 17 | struct mt7996_link_sta *mlink = |
| 18 | rcu_dereference(msta->link[link_id]); |
| 19 | |
| 20 | - if (list_empty(&mlink->wcid.poll_list)) |
| 21 | + if (mlink && list_empty(&mlink->wcid.poll_list)) |
| 22 | list_add_tail(&mlink->wcid.poll_list, &mdev->sta_poll_list); |
| 23 | } |
| 24 | spin_unlock_bh(&mdev->sta_poll_lock); |
| 25 | -- |
| 26 | 2.18.0 |
| 27 | |