wifi: mt76: mt7996: fix crash in mt7996_set_radar_background

When disabling background radar detection, chandef is NULL

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2025-01-09 14:21:21 +01:00
parent e354436db4
commit cf4e709e49
+5 -1
View File
@@ -1555,10 +1555,14 @@ mt7996_set_radar_background(struct ieee80211_hw *hw,
struct cfg80211_chan_def *chandef)
{
struct mt7996_dev *dev = mt7996_hw_dev(hw);
struct mt7996_phy *phy = mt7996_band_phy(dev, chandef->chan->band);
struct mt7996_phy *phy;
int ret = -EINVAL;
bool running;
if (chandef)
phy = mt7996_band_phy(dev, chandef->chan->band);
else
phy = dev->rdd2_phy;
if (!phy)
return -EINVAL;