Skip to content

Commit

Permalink
cfg80211: fully initialize old channel for event
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
jmberg-intel committed Jan 15, 2018
1 parent 8155aed commit a48a52b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a48a52b

Please sign in to comment.