| From e509c27732a53efc496081261df1c80b22a02b45 Mon Sep 17 00:00:00 2001 |
| From: Bo Jiao <Bo.Jiao@mediatek.com> |
| Date: Thu, 27 Jun 2024 14:54:38 +0800 |
| Subject: [PATCH 156/193] mtk: mt76: mt7996: Fix NULL pointer crash when mac tx |
| free with a msta that has been removed. |
| |
| Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com> |
| --- |
| mt7996/mac.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/mt7996/mac.c b/mt7996/mac.c |
| index ee505a5..3cd034c 100644 |
| --- a/mt7996/mac.c |
| +++ b/mt7996/mac.c |
| @@ -1212,7 +1212,7 @@ mt7996_mac_tx_free(struct mt7996_dev *dev, void *data, int len) |
| struct mt7996_link_sta *mlink = |
| rcu_dereference(msta->link[link_id]); |
| |
| - if (list_empty(&mlink->wcid.poll_list)) |
| + if (mlink && list_empty(&mlink->wcid.poll_list)) |
| list_add_tail(&mlink->wcid.poll_list, &mdev->sta_poll_list); |
| } |
| spin_unlock_bh(&mdev->sta_poll_lock); |
| -- |
| 2.45.2 |
| |