summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRyder Lee <ryder.lee@mediatek.com>2025-09-22 22:19:08 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-15 12:04:05 +0200
commit2feef19cd9a9d632cbb31b1db3592591ad9baee6 (patch)
tree50ef5c869dbc67d410b3252fd59541d4a7f3a7b1 /net
parent7da4876b3f84af687fe76d1340a0aa1a24fa3b07 (diff)
downloadlinux-2feef19cd9a9d632cbb31b1db3592591ad9baee6.tar.gz
linux-2feef19cd9a9d632cbb31b1db3592591ad9baee6.tar.bz2
linux-2feef19cd9a9d632cbb31b1db3592591ad9baee6.zip
wifi: cfg80211: fix width unit in cfg80211_radio_chandef_valid()
[ Upstream commit 17f34ab55a8518ecbd5dcacec48e6ee903f7c1d0 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-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 240c68baa3d1..341dbf642181 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -2992,7 +2992,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;