From fa3d334a0e22049535aa3efea08fd5d2589cc975 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 19 Jan 2021 13:19:53 +0100 Subject: [PATCH] mt76: fix crash on tearing down ext phy Only clear dev->phy2 after the phy is gone, the driver may still need to access it until shutdown is complete Signed-off-by: Felix Fietkau --- mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mac80211.c b/mac80211.c index b216a4c1..7ada5a8f 100644 --- a/mac80211.c +++ b/mac80211.c @@ -387,9 +387,9 @@ void mt76_unregister_phy(struct mt76_phy *phy) { struct mt76_dev *dev = phy->dev; - dev->phy2 = NULL; mt76_tx_status_check(dev, NULL, true); ieee80211_unregister_hw(phy->hw); + dev->phy2 = NULL; } EXPORT_SYMBOL_GPL(mt76_unregister_phy);