summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2021-04-10 14:14:02 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2021-04-10 14:14:02 +0200
commit3078eb2aede4db1b77d1a162473113d693aec120 (patch)
tree5333fa72066046797f488467676e0d48caf7143f /net
parent816b5bcff6fe2e18ee7e30a300c13e1e97d51f23 (diff)
parent23a86a94a323fdd1c3ca7cf6dc032dd380db8658 (diff)
Merge 4.4.266 into android-4.4-p
Changes in 4.4.266 net: pxa168_eth: Fix a potential data race in pxa168_eth_remove mISDN: fix crash in fritzpci mac80211: choose first enabled channel for monitor x86/build: Turn off -fcf-protection for realmode targets ia64: mca: allocate early mca with GFP_ATOMIC cifs: revalidate mapping when we open files for SMB1 POSIX cifs: Silently ignore unknown oplock break handle bpf, x86: Validate computation of branch displacements for x86-64 ALSA: hda/realtek - Fix pincfg for Dell XPS 13 9370 mtd: rawnand: tmio: Fix the probe error path mtd: rawnand: socrates: Fix the probe error path mtd: rawnand: sharpsl: Fix the probe error path mtd: rawnand: plat_nand: Fix the probe error path mtd: rawnand: pasemi: Fix the probe error path mtd: rawnand: orion: Fix the probe error path mtd: rawnand: diskonchip: Fix the probe error path tracing: Add a vmalloc_sync_mappings() for safe measure init/Kconfig: make COMPILE_TEST depend on !UML init/Kconfig: make COMPILE_TEST depend on !S390 init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing bitrate Linux 4.4.266 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I883b5323d84e86d2e3cefb8febdfa92c6e61c3fd
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/main.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 15d23aeea634..2357b17254e7 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -889,8 +889,19 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
continue;
if (!dflt_chandef.chan) {
+ /*
+ * Assign the first enabled channel to dflt_chandef
+ * from the list of channels
+ */
+ for (i = 0; i < sband->n_channels; i++)
+ if (!(sband->channels[i].flags &
+ IEEE80211_CHAN_DISABLED))
+ break;
+ /* if none found then use the first anyway */
+ if (i == sband->n_channels)
+ i = 0;
cfg80211_chandef_create(&dflt_chandef,
- &sband->channels[0],
+ &sband->channels[i],
NL80211_CHAN_NO_HT);
/* init channel we're on */
if (!local->use_chanctx && !local->_oper_chandef.chan) {