wlan: Protect nl80211 vendor commands from SSR

Protect nl80211 vendor commands from accessing deallocated
and unitialized data structures while SSR is in progress.

Change-Id: I8983cacc86e02389521679c86f1d7869dd3510a3
CRs-Fixed: 787916
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index 8098473..e7a9523 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -452,7 +452,7 @@
 
 }
 
-void hdd_ipv6_notifier_work_queue(struct work_struct *work)
+void __hdd_ipv6_notifier_work_queue(struct work_struct *work)
 {
     hdd_adapter_t* pAdapter =
              container_of(work, hdd_adapter_t, ipv6NotifierWorkQueue);
@@ -460,12 +460,17 @@
     int status;
 
     hddLog(LOG1, FL("Reconfiguring NS Offload"));
+    if (NULL == pAdapter)
+    {
+        hddLog(LOGE, FL("Adapter is invalid"));
+        return;
+    }
 
     pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
     status = wlan_hdd_validate_context(pHddCtx);
     if (0 != status)
     {
-        hddLog(LOGE, FL("HDD context is invalid"));
+        hddLog(LOGE, FL("HDD context is invalid, status = %d"), status);
         return;
     }
 
@@ -502,7 +507,12 @@
 
 }
 
-
+void hdd_ipv6_notifier_work_queue(struct work_struct *work)
+{
+     vos_ssr_protect(__func__);
+     __hdd_ipv6_notifier_work_queue(work);
+     vos_ssr_unprotect(__func__);
+}
 int wlan_hdd_ipv6_changed(struct notifier_block *nb,
                             unsigned long data, void *arg)
 {
@@ -931,7 +941,7 @@
 }
 #endif
 
-void hdd_ipv4_notifier_work_queue(struct work_struct *work)
+void __hdd_ipv4_notifier_work_queue(struct work_struct *work)
 {
     hdd_adapter_t* pAdapter =
              container_of(work, hdd_adapter_t, ipv4NotifierWorkQueue);
@@ -939,11 +949,16 @@
     int status;
 
     hddLog(LOG1, FL("Reconfiguring ARP Offload"));
+    if (NULL == pAdapter)
+    {
+        hddLog(LOGE, FL("Adapter is invalid"));
+        return;
+    }
     pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
     status = wlan_hdd_validate_context(pHddCtx);
     if (0 != status)
     {
-        hddLog(LOGE, FL("HDD context is invalid"));
+        hddLog(LOGE, FL("HDD context is invalid, status = %d"), status);
         return;
     }
 
@@ -967,6 +982,13 @@
     }
 }
 
+void hdd_ipv4_notifier_work_queue(struct work_struct *work)
+{
+    vos_ssr_protect(__func__);
+    __hdd_ipv4_notifier_work_queue(work);
+    vos_ssr_unprotect(__func__);
+}
+
 int wlan_hdd_ipv4_changed(struct notifier_block *nb,
                             unsigned long data, void *arg)
 {