wlan: Fix NULL pointer dereference in hdd_set_tdls_scan_type

In hdd_set_tdls_scan_type (), pAdapter is checked for NULL after
being accessed. Change is made to fix this.

CRs-Fixed: 785373
Change-Id: Ia7b9aca3fcdb3acc0f30dd7ef1eecf5786fc0e79
diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c
index 026a335..fafae28 100644
--- a/CORE/HDD/src/wlan_hdd_tdls.c
+++ b/CORE/HDD/src/wlan_hdd_tdls.c
@@ -2906,13 +2906,14 @@
                    tANI_U8 *ptr)
 {
     int tdls_scan_type;
-    hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+    hdd_context_t *pHddCtx;
     if (NULL == pAdapter)
     {
         VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
                   "%s: pAdapter is NULL", __func__);
         return -EINVAL;
     }
+    pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
     tdls_scan_type = ptr[9] - '0';
 
     if (tdls_scan_type <= 2)