wlan: Fix crash when the regulatory notifier is called unitialized
When the driver regulatory notifier is called, it may also get called
even when the driver did not initiate regulatory_hint. In such a case,
the completion variable linux_reg_req can be unitialized and lead to
a crash.
CRs-fixed: 538940
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index cc77ec8..9ee03f1 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -642,7 +642,7 @@
/* This will disable updating of NL channels from passive to
* active if a beacon is received on passive channel. */
wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS;
- wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME
diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c
index 29043d1..31686d4 100644
--- a/CORE/VOSS/src/vos_nvitem.c
+++ b/CORE/VOSS/src/vos_nvitem.c
@@ -2250,6 +2250,8 @@
int bw20_start_channel_index, bw20_end_channel_index;
int bw40_start_channel_index, bw40_end_channel_index;
+ if (NULL == wiphy->regd)
+ return;
for (n = 0; n < NUM_RF_CHANNELS; n++)
pnvEFSTable->halnv.tables.regDomains[domain_id].channels[n].enabled =
@@ -2872,6 +2874,8 @@
driver_callback_called = VOS_TRUE;
kernel_reg_request_made = VOS_FALSE;
+ complete(&pHddCtx->linux_reg_req);
+
}
else {
@@ -2890,8 +2894,6 @@
}
- complete(&pHddCtx->linux_reg_req);
-
return;
}