mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7925: drop redundant chandef.chan NULL check in MT7927 path
In mt7925_mac_link_bss_add(), the MT7927 branch added an else-if that checked mvif->phy->mt76->chandef.chan before assigning it to the local chan pointer. If that check failed, chan stayed NULL and chan->band was dereferenced unconditionally a line later. phy->chandef.chan is set during phy registration in mt76_check_sband() and is never cleared, so the check is a no-op. Drop it and use the chandef channel as an unconditional fallback, matching the assumption made elsewhere in the driver (e.g. the existing basic_rates_idx selection right below this block and mt7925/mac.c). Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+2
-2
@@ -398,11 +398,11 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev,
|
||||
mconf->mt76.band_idx = 0xff;
|
||||
|
||||
if (is_mt7927(&dev->mt76)) {
|
||||
struct ieee80211_channel *chan = NULL;
|
||||
struct ieee80211_channel *chan;
|
||||
|
||||
if (link_conf->chanreq.oper.chan)
|
||||
chan = link_conf->chanreq.oper.chan;
|
||||
else if (mvif->phy->mt76->chandef.chan)
|
||||
else
|
||||
chan = mvif->phy->mt76->chandef.chan;
|
||||
|
||||
mconf->mt76.band_idx = mt7927_band_idx(chan->band);
|
||||
|
||||
Reference in New Issue
Block a user