wlan: Don't honour scan done callback on interface down

From Kernel-3.18 onwards pending scan request is handled
as part of NETDEV_DOWN event, by invoking the cfg80211_scan_done
callback which frees the scan request structure. At the same
time driver invokes scan done callback and tries to access scan
request structure which is already freed by the kernel.

Since kernel takes care of completing the scan handler upon
NETDEV_DOWN, no need to invoke the same callback.

Change-Id: I8203c5a15913b29c89ad687cfd58c6b2cc2a58ac
CRs-Fixed: 958903
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 5fac51a..3c35ab7 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -12547,6 +12547,13 @@
         goto allow_suspend;
     }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
+    if (!(pAdapter->dev->flags & IFF_UP))
+    {
+        hddLog(VOS_TRACE_LEVEL_ERROR, FL("Interface is down"));
+        goto allow_suspend;
+    }
+#endif
     pScanInfo = &pHddCtx->scan_info;
 
     hddLog(VOS_TRACE_LEVEL_INFO,
@@ -12662,10 +12669,7 @@
          aborted = true;
     }
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
-    if (pAdapter->dev->flags & IFF_UP)
-#endif
-        cfg80211_scan_done(req, aborted);
+    cfg80211_scan_done(req, aborted);
 
     complete(&pScanInfo->abortscan_event_var);