]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
mt76: fix crash on tearing down ext phy
authorFelix Fietkau <nbd@nbd.name>
Tue, 19 Jan 2021 12:19:53 +0000 (13:19 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 27 Jan 2021 16:30:01 +0000 (17:30 +0100)
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 <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mac80211.c

index f2714436883b7697b24144121a6f9a9d104b3179..696d00d1976ca80d6f5c7f51d852a9c112dfe9b9 100644 (file)
@@ -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);