From 6585a4353a51c0e4873b691bbcab251dffc7e2bb Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 17 Jul 2024 17:26:52 +0200 Subject: [PATCH] wifi: mt76: mt7921: fix crash on ipv6 addr notification during vif bringup mvif->phy is NULL when the interface is not properly initialized yet Signed-off-by: Felix Fietkau --- mt7921/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mt7921/main.c b/mt7921/main.c index 162f5b70..26217874 100644 --- a/mt7921/main.c +++ b/mt7921/main.c @@ -1183,7 +1183,7 @@ static void mt7921_ipv6_addr_change(struct ieee80211_hw *hw, struct inet6_dev *idev) { struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; - struct mt792x_dev *dev = mvif->phy->dev; + struct mt792x_dev *dev = mt792x_hw_dev(hw); struct inet6_ifaddr *ifa; struct in6_addr ns_addrs[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; struct sk_buff *skb; @@ -1206,6 +1206,9 @@ static void mt7921_ipv6_addr_change(struct ieee80211_hw *hw, }, }; + if (!mvif->phy) + return; + read_lock_bh(&idev->lock); list_for_each_entry(ifa, &idev->addr_list, if_list) { if (ifa->flags & IFA_F_TENTATIVE)