summaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2018-01-15 09:12:05 +0100
committerJohannes Berg <johannes.berg@intel.com>2018-01-15 09:15:03 +0100
commita48a52b7bea81c046fe1c1288f84d0eba214cba0 (patch)
treed8c2bdef5b020e4c8f584e85407069e1b924f971 /net/wireless/reg.c
parent8155aedf512edd3f88ef19f7cacf476ace7d1322 (diff)
downloadlinux-a48a52b7bea81c046fe1c1288f84d0eba214cba0.tar.gz
linux-a48a52b7bea81c046fe1c1288f84d0eba214cba0.tar.bz2
linux-a48a52b7bea81c046fe1c1288f84d0eba214cba0.zip
cfg80211: fully initialize old channel for event
Paul reported that he got a report about undefined behaviour that seems to me to originate in using uninitialized memory when the channel structure here is used in the event code in nl80211 later. He never reported whether this fixed it, and I wasn't able to trigger this so far, but we should do the right thing and fully initialize the on-stack structure anyway. Reported-by: Paul Menzel <pmenzel+linux-wireless@molgen.mpg.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 78e71b0390be..7b42f0bacfd8 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1769,8 +1769,7 @@ static void handle_reg_beacon(struct wiphy *wiphy, unsigned int chan_idx,
if (wiphy->regulatory_flags & REGULATORY_DISABLE_BEACON_HINTS)
return;
- chan_before.center_freq = chan->center_freq;
- chan_before.flags = chan->flags;
+ chan_before = *chan;
if (chan->flags & IEEE80211_CHAN_NO_IR) {
chan->flags &= ~IEEE80211_CHAN_NO_IR;