summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 5dfadecccbba..dd030326cdf4 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -17349,6 +17349,42 @@ VOS_STATUS wlan_hdd_cfg80211_roam_metrics_handover(hdd_adapter_t * pAdapter,
}
#endif
+
+/**
+ * wlan_hdd_cfg80211_validate_scan_req - validate scan request
+ * @scan_req: scan request to be checked
+ *
+ * Return: true or false
+ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
+static inline bool wlan_hdd_cfg80211_validate_scan_req(struct
+ cfg80211_scan_request
+ *scan_req)
+{
+ if (!scan_req || !scan_req->wiphy) {
+ hddLog(VOS_TRACE_LEVEL_ERROR, "Invalid scan request");
+ return false;
+ }
+ if (vos_is_load_unload_in_progress(VOS_MODULE_ID_HDD, NULL)) {
+ hddLog(VOS_TRACE_LEVEL_ERROR, "Load/Unload in progress");
+ return false;
+ }
+ return true;
+}
+#else
+static inline bool wlan_hdd_cfg80211_validate_scan_req(struct
+ cfg80211_scan_request
+ *scan_req)
+{
+ if (!scan_req || !scan_req->wiphy) {
+ hddLog(VOS_TRACE_LEVEL_ERROR, "Invalid scan request");
+ return false;
+ }
+ return true;
+}
+#endif
+
+
/*
* FUNCTION: hdd_cfg80211_scan_done_callback
* scanning callback function, called after finishing scan
@@ -17489,9 +17525,17 @@ static eHalStatus hdd_cfg80211_scan_done_callback(tHalHandle halHandle,
/* Scan is no longer pending */
pScanInfo->mScanPending = VOS_FALSE;
- if (!req || req->wiphy == NULL)
+ if (!wlan_hdd_cfg80211_validate_scan_req(req))
{
- hddLog(VOS_TRACE_LEVEL_ERROR, "request is became NULL");
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
+ hddLog(VOS_TRACE_LEVEL_ERROR, FL("interface state %s"),
+ iface_down ? "up" : "down");
+#endif
+ if (pAdapter->dev)
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR, FL("device name %s"),
+ pAdapter->dev->name);
+ }
complete(&pScanInfo->abortscan_event_var);
goto allow_suspend;
}