mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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: 510dba80ed ("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>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user