wlan: Avoid kernel panic during handing ioctl

To avoid kernel panic do not allow ioctl to execute
if hdd context is invalid.

Change-Id: Idea5b86dd2bf350816004385878e54de656e1957
CRs-Fixed: 720763
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index ad10d35..3c31434 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -5845,9 +5845,11 @@
     int apps_args[MAX_VAR_ARGS] = {0};
     int num_args;
     hdd_station_ctx_t *pStaCtx = NULL ;
+    hdd_context_t *pHddCtx = NULL;
     hdd_ap_ctx_t  *pAPCtx = NULL;
     int cmd = 0;
     int staId = 0;
+    int ret = 0;
     struct iw_point s_priv_data;
 
     /* helper function to get iwreq_data with compat handling. */
@@ -5866,11 +5868,13 @@
 
     hddLog(LOG1, "%s: Received length %d", __func__, s_priv_data.length);
 
-    if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress)
+    pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+    ret = wlan_hdd_validate_context(pHddCtx);
+    if (0 != ret)
     {
-        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
-                                  "%s:LOGP in Progress. Ignore!!!", __func__);
-        return -EBUSY;
+        VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                    "%s: HDD context is Null", __func__);
+        return ret;
     }
 
     if (num_args > MAX_VAR_ARGS)