prima: Validate Adapter in scan done callback

From static analysis it is found that adapter is not being
validated before being accessed.This can lead to null pointer exception
during corner cases.
Do NULL check for Adapter before accessing.

Change-Id: I8abec02d3cf546c1e7790c3f7dfaff9ac373ff6d
CRs-Fixed: 1082363
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 0e5ed0d..961162c 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -12694,6 +12694,11 @@
 
     ENTER();
 
+    if (!pAdapter || pAdapter->magic != WLAN_HDD_ADAPTER_MAGIC ||
+        !pAdapter->dev) {
+        hddLog(VOS_TRACE_LEVEL_ERROR, FL("Adapter is not valid"));
+        return 0;
+    }
     pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
     if (NULL == pHddCtx) {
         hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is Null"));