wlan: MAC context set to NULL in HDD context after driver shutdown in SSR

MAC context is released during SSR driver shutdown procedure but the
same context pointer is retained in hdd context which can be accessed
during cfg API's while SSR is still in progress and can lead to
corruption of kernel heap memory OR data abort if that particular address
is paged out. As part of this fix, the context pointer is now set to NULL.

CRs-Fixed: 447340
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 4f8d30b..3291493 100755
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -5907,7 +5907,6 @@
 
     hdd_context_t *pHddCtx = (hdd_context_t*) wiphy_priv(wiphy);
     hdd_config_t  *pCfg    = pHddCtx->cfg_ini;
-    tHalHandle hHal        = WLAN_HDD_GET_HAL_CTX(pAdapter);
 
     tANI_U8  OperationalRates[CSR_DOT11_SUPPORTED_RATES_MAX];
     tANI_U32 ORLeng = CSR_DOT11_SUPPORTED_RATES_MAX;
@@ -6006,7 +6005,14 @@
         maxRate = 0;
 
         /* Get Basic Rate Set */
-        ccmCfgGetStr(hHal, WNI_CFG_OPERATIONAL_RATE_SET, OperationalRates, &ORLeng);
+        if (0 != ccmCfgGetStr(WLAN_HDD_GET_HAL_CTX(pAdapter), WNI_CFG_OPERATIONAL_RATE_SET,
+                             OperationalRates, &ORLeng))
+        {
+            hddLog(VOS_TRACE_LEVEL_ERROR, "%s: ccm api returned failure", __func__);
+            /*To keep GUI happy*/
+            return 0;
+        }
+
         for (i = 0; i < ORLeng; i++)
         {
             for (j = 0; j < (sizeof(supported_data_rate) / sizeof(supported_data_rate[0])); j ++)
@@ -6023,7 +6029,14 @@
         }
 
         /* Get Extended Rate Set */
-        ccmCfgGetStr(hHal, WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET, ExtendedRates, &ERLeng);
+        if (0 != ccmCfgGetStr(WLAN_HDD_GET_HAL_CTX(pAdapter), WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET,
+                             ExtendedRates, &ERLeng))
+        {
+            hddLog(VOS_TRACE_LEVEL_ERROR, "%s: ccm api returned failure", __func__);
+            /*To keep GUI happy*/
+            return 0;
+        }
+
         for (i = 0; i < ERLeng; i++)
         {
             for (j = 0; j < (sizeof(supported_data_rate) / sizeof(supported_data_rate[0])); j ++)
@@ -6043,7 +6056,13 @@
            good rssi */
         if ((0 == rssidx) && !(rate_flags & eHAL_TX_RATE_LEGACY))
         {
-            ccmCfgGetStr(hHal, WNI_CFG_CURRENT_MCS_SET, MCSRates, &MCSLeng);
+            if (0 != ccmCfgGetStr(WLAN_HDD_GET_HAL_CTX(pAdapter), WNI_CFG_CURRENT_MCS_SET,
+                                 MCSRates, &MCSLeng))
+            {
+                hddLog(VOS_TRACE_LEVEL_ERROR, "%s: ccm api returned failure", __func__);
+                /*To keep GUI happy*/
+                return 0;
+            }
             rateFlag = 0;
             if (rate_flags & eHAL_TX_RATE_HT40)
             {