Commit c9dbeac4 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: connac: fix a theoretical NULL pointer dereference in mt76_connac_get_phy_mode

Even if it is not a real bug since mt76_connac_get_phy_mode runs just
for mt7921 where only STA is supported, fix a theoretical NULL pointer
dereference if new added modes do not support HE
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent ec2ebc1c
...@@ -1179,7 +1179,7 @@ mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif, ...@@ -1179,7 +1179,7 @@ mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
if (ht_cap->ht_supported) if (ht_cap->ht_supported)
mode |= PHY_MODE_GN; mode |= PHY_MODE_GN;
if (he_cap->has_he) if (he_cap && he_cap->has_he)
mode |= PHY_MODE_AX_24G; mode |= PHY_MODE_AX_24G;
} else if (band == NL80211_BAND_5GHZ || band == NL80211_BAND_6GHZ) { } else if (band == NL80211_BAND_5GHZ || band == NL80211_BAND_6GHZ) {
mode |= PHY_MODE_A; mode |= PHY_MODE_A;
...@@ -1190,7 +1190,7 @@ mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif, ...@@ -1190,7 +1190,7 @@ mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
if (vht_cap->vht_supported) if (vht_cap->vht_supported)
mode |= PHY_MODE_AC; mode |= PHY_MODE_AC;
if (he_cap->has_he) { if (he_cap && he_cap->has_he) {
if (band == NL80211_BAND_6GHZ) if (band == NL80211_BAND_6GHZ)
mode |= PHY_MODE_AX_6G; mode |= PHY_MODE_AX_6G;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment