qcacld-3.0: Fix hdd_ctx NULL pointer dereference

Fix hdd_ctx and stainfo NULL pointer dereference in
DFS indicate radar function.

Change-Id: Ia74e9a99fd46095e9a474f668c3431e441a38d8a
CRs-Fixed: 2177004
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 08f5ffc..6692713 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -2011,7 +2011,12 @@
 	struct hdd_adapter *adapter;
 	struct hdd_ap_ctx *ap_ctx;
 
-	if (!hdd_ctx || hdd_ctx->config->disableDFSChSwitch) {
+	if (!hdd_ctx) {
+		hdd_info("Couldn't get hdd_ctx");
+		return true;
+	}
+
+	if (hdd_ctx->config->disableDFSChSwitch) {
 		hdd_info("skip tx block hdd_ctx=%pK, disableDFSChSwitch=%d",
 			 hdd_ctx, hdd_ctx->config->disableDFSChSwitch);
 		return true;
@@ -10772,10 +10777,9 @@
 		stainfo->rssi = peer_sta_info.info[0].rssi;
 		stainfo->tx_rate = peer_sta_info.info[0].tx_rate;
 		stainfo->rx_rate = peer_sta_info.info[0].rx_rate;
+		stainfo->reason_code = pDelStaParams->reason_code;
 	}
 
-	stainfo->reason_code = pDelStaParams->reason_code;
-
 	wlansap_disassoc_sta(WLAN_HDD_GET_SAP_CTX_PTR(adapter),
 			     pDelStaParams);
 }