wifi: mt76: mt7921: fix NULL pointer access in mt7921_ipv6_addr_change
Subsystems (2)
PATCH 1/1 wifi: mt76: mt7921: fix NULL pointer access in mt7921_ipv6_addr_change
When disabling wifi mt7921_ipv6_addr_change() is called as a notifier. At this point mvif->phy is already NULL so we cannot use it here.
Signed-off-by Bert Karwatzki <[email protected]>
Signed-off-by Felix Fietkau <[email protected]>
--- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7921/main.c +1 -1
@@ -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;
--
2.45.2
As the solution comes from Felix Fietkau I put in a Signed-off-by for him in the commit message. I hope this is ok.
Bert Karwatzki
Quoted 5 lines · Bert Karwatzki
When disabling wifi
mt7921_ipv6_addr_change()is called as a notifier. At this pointmvif->phyis already NULL so we cannot use it here.Signed-off-by Bert Karwatzki <[email protected]>Signed-off-by Felix Fietkau <[email protected]>
Patch applied to wireless.git, thanks.
479ffee68d59 wifi: mt76: mt7921: fix NULL pointer access in mt7921_ipv6_addr_change
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches