From 653dab432bdc3f8b45c7a661cc8952834681f5e4 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Wed, 19 Dec 2012 10:53:02 -0800 Subject: [PATCH] --- yaml --- r: 351758 b: refs/heads/master c: 3ebfa6e76beab01e644e1facd5fdb84d4274043e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/wireless/reg.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index fe9a7804b0b8..b7d31c9a2db0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ad2d223aa900179031feb40273881e212941573d +refs/heads/master: 3ebfa6e76beab01e644e1facd5fdb84d4274043e diff --git a/trunk/net/wireless/reg.c b/trunk/net/wireless/reg.c index fd53d975c0bc..2a3ae4d1001d 100644 --- a/trunk/net/wireless/reg.c +++ b/trunk/net/wireless/reg.c @@ -1925,11 +1925,23 @@ static bool freq_is_chan_12_13_14(u16 freq) return false; } +static bool pending_reg_beacon(struct ieee80211_channel *beacon_chan) +{ + struct reg_beacon *pending_beacon; + + list_for_each_entry(pending_beacon, ®_pending_beacons, list) + if (beacon_chan->center_freq == + pending_beacon->chan.center_freq) + return true; + return false; +} + int regulatory_hint_found_beacon(struct wiphy *wiphy, struct ieee80211_channel *beacon_chan, gfp_t gfp) { struct reg_beacon *reg_beacon; + bool processing; if (beacon_chan->beacon_found || beacon_chan->flags & IEEE80211_CHAN_RADAR || @@ -1937,6 +1949,13 @@ int regulatory_hint_found_beacon(struct wiphy *wiphy, !freq_is_chan_12_13_14(beacon_chan->center_freq))) return 0; + spin_lock_bh(®_pending_beacons_lock); + processing = pending_reg_beacon(beacon_chan); + spin_unlock_bh(®_pending_beacons_lock); + + if (processing) + return 0; + reg_beacon = kzalloc(sizeof(struct reg_beacon), gfp); if (!reg_beacon) return -ENOMEM;