linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH wireless] wifi: mt76: mt7921: fix NULL pointer access in mt7921_ipv6_addr_change
@ 2024-08-12 10:45 Bert Karwatzki
  2024-08-13  9:49 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Bert Karwatzki @ 2024-08-12 10:45 UTC (permalink / raw)
  To: linux-wireless
  Cc: Bert Karwatzki, Kalle Valo, Felix Fietkau, Sean Wang, deren.wu,
	linux-mediatek, lorenzo.bianconi, mingyen.hsieh, sean.wang,
	linux-kernel

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 <spasswolf@web.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/mt7921/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index 1bab93d049df..23b228804289 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/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;
--
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH wireless] wifi: mt76: mt7921: fix NULL pointer access in mt7921_ipv6_addr_change
  2024-08-12 10:45 [PATCH wireless] wifi: mt76: mt7921: fix NULL pointer access in mt7921_ipv6_addr_change Bert Karwatzki
@ 2024-08-13  9:49 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2024-08-13  9:49 UTC (permalink / raw)
  To: Bert Karwatzki
  Cc: linux-wireless, Bert Karwatzki, Felix Fietkau, Sean Wang,
	deren.wu, linux-mediatek, lorenzo.bianconi, mingyen.hsieh,
	sean.wang, linux-kernel

Bert Karwatzki <spasswolf@web.de> wrote:

> 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 <spasswolf@web.de>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

Patch applied to wireless.git, thanks.

479ffee68d59 wifi: mt76: mt7921: fix NULL pointer access in mt7921_ipv6_addr_change

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240812104542.80760-1-spasswolf@web.de/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-13  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 10:45 [PATCH wireless] wifi: mt76: mt7921: fix NULL pointer access in mt7921_ipv6_addr_change Bert Karwatzki
2024-08-13  9:49 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).