summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyder Lee <ryder.lee@mediatek.com>2025-09-22 22:19:08 +0000
committerJohannes Berg <johannes.berg@intel.com>2025-09-23 09:50:02 +0200
commit17f34ab55a8518ecbd5dcacec48e6ee903f7c1d0 (patch)
tree9bb9bb3b04df8006d9877ef6948e521b0f9d4c51
parent2d6a229ecc2d4458352af431cf5d0382fc40c8cd (diff)
wifi: cfg80211: fix width unit in cfg80211_radio_chandef_valid()
The original code used nl80211_chan_width_to_mhz(), which returns the width in MHz. However, the expected unit is KHz. Fixes: 510dba80ed66 ("wifi: cfg80211: add helper for checking if a chandef is valid on a radio") Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Link: https://patch.msgid.link/df54294e6c4ed0f3ceff6e818b710478ddfc62c0.1758579480.git.Ryder%20Lee%20ryder.lee@mediatek.com/ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/wireless/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index f26440d18ad3..56724b33af04 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -2965,7 +2965,7 @@ bool cfg80211_radio_chandef_valid(const struct wiphy_radio *radio,
u32 freq, width;
freq = ieee80211_chandef_to_khz(chandef);
- width = cfg80211_chandef_get_width(chandef);
+ width = MHZ_TO_KHZ(cfg80211_chandef_get_width(chandef));
if (!ieee80211_radio_freq_range_valid(radio, freq, width))
return false;