diff mbox series

Add non-null judgement branch for return value of mt76_connac_get_he_phy_cap().

Message ID 20250611134209.312009-1-houzhanyi61@buaa.edu.cn
State New
Headers show
Series Add non-null judgement branch for return value of mt76_connac_get_he_phy_cap(). | expand

Commit Message

hzy15610046011 June 11, 2025, 1:42 p.m. UTC
From: H-Mole <houzhanyi61@buaa.edu.cn>

Since commit https://github.com/torvalds/linux/commit/f503ae90c7355e8506e68498fe84c1357894cd5b
 showed that drivers/net/wireless/mediatek/mt76/mt7996/mcu.c misses a non-null judgement for the
 return value of mt76_connac_get_he_phy_cap on variable vc, this null-pointer problem may also happen
 on mt7915. This commit added such non-null judgement like what was added to function mt7996_mcu_sta_bfer_he()
 in commit f503ae90c7355e8506e68498fe84c1357894cd5b.

Signed-off-by: H-Mole <houzhanyi61@buaa.edu.cn>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 427542777abc..5dca50d40080 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -1184,6 +1184,9 @@  mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
 	u8 nss_mcs = mt7915_mcu_get_sta_nss(mcs_map);
 	u8 snd_dim, sts;
 
+	if (!vc)
+		return;
+
 	bf->tx_mode = MT_PHY_TYPE_HE_SU;
 
 	mt7915_mcu_sta_sounding_rate(bf);