mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
wifi: cfg80211: restrict cfg80211_chandef_create() to only HT-based bands
cfg80211_chandef_create() should only be used by bands that are HT-based and the chantype argument makes sense. Insert a WARN such that it isn't used on 60GHz and S1GHz bands and to catch any potential existing uses by those bands. Suggested-by: Johannes Berg <[email protected]> Signed-off-by: Lachlan Hodges <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
committed by
Johannes Berg
parent
a6d4291eae
commit
92d77e06e7
+3
-1
@@ -29,9 +29,11 @@ void cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
|
||||
|
||||
*chandef = (struct cfg80211_chan_def) {
|
||||
.chan = chan,
|
||||
.freq1_offset = chan->freq_offset,
|
||||
};
|
||||
|
||||
WARN_ON(chan->band == NL80211_BAND_60GHZ ||
|
||||
chan->band == NL80211_BAND_S1GHZ);
|
||||
|
||||
switch (chan_type) {
|
||||
case NL80211_CHAN_NO_HT:
|
||||
chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
|
||||
|
||||
Reference in New Issue
Block a user