blob: e14d128843ec08582c656eb465bcdf6d6ee60934 [file] [log] [blame]
From 8f1b477c5734b3e46dd8d6795c784ef58d553d74 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 168/199] 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 2f37d31c..12cc60cb 100644
--- a/mt7996/mac.c
+++ b/mt7996/mac.c
@@ -1200,7 +1200,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.18.0