From f610d91865b8e0ef483eadfbea3c500c998fdb0e Mon Sep 17 00:00:00 2001 From: Jiachao Wu Date: Tue, 23 Jan 2018 17:47:32 +0800 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 08f5ffc82ee3..6692713578e6 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2011,7 +2011,12 @@ bool hdd_dfs_indicate_radar(struct hdd_context *hdd_ctx) 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 @@ void hdd_softap_sta_disassoc(struct hdd_adapter *adapter, 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); }