Skip to content

Commit 255e25b

Browse files
mcgrofjmberg-intel
authored andcommitted
cfg80211: allow reprocessing of pending requests
In certain situations we want to trigger reprocessing of the last regulatory hint. One situation in which this makes sense is the case where the cfg80211 was built-in to the kernel, CFG80211_INTERNAL_REGDB was not enabled and the CRDA binary is on a partition not availble during early boot. In such a case we want to be able to re-process the same request at some other point. When we are asked to re-process the same request we need to be careful to not kfree it, addresses that. Reported-by: Sander Eikelenboom <linux@eikelenboom.it> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> [rename function] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent b8ff416 commit 255e25b

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎net/wireless/reg.c‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,19 +240,21 @@ static char user_alpha2[2];
240240
module_param(ieee80211_regdom, charp, 0444);
241241
MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
242242

243-
static void reg_kfree_last_request(void)
243+
static void reg_free_request(struct regulatory_request *lr)
244244
{
245-
struct regulatory_request *lr;
246-
247-
lr = get_last_request();
248-
249245
if (lr != &core_request_world && lr)
250246
kfree_rcu(lr, rcu_head);
251247
}
252248

253249
static void reg_update_last_request(struct regulatory_request *request)
254250
{
255-
reg_kfree_last_request();
251+
struct regulatory_request *lr;
252+
253+
lr = get_last_request();
254+
if (lr == request)
255+
return;
256+
257+
reg_free_request(lr);
256258
rcu_assign_pointer(last_request, request);
257259
}
258260

0 commit comments

Comments
 (0)