diff options
| author | Liangwei Dong <liangwei@codeaurora.org> | 2018-05-11 16:05:50 +0800 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-05-16 10:20:24 -0700 |
| commit | 83642dc9afb9cc6ebe1ab2c9d96357b6fe28a3ec (patch) | |
| tree | c24bd4ed5e35a4f6556ae25fd0b681ce25136a94 | |
| parent | 146bb4078704cd0c744f75350929529c93d4ea53 (diff) | |
qcacld-3.0: Fix NULL acs_cfg ptr access
qcacld-3.2 to qcacld-3.1 propagation
acs_cfg is not initialized when sap starts
failed. And acs_cfg is accessed during
Random channel selection when sap interface
gets Radar event.
Fix by checking sap ctx state and acs_cfg
During dfs radar event.
Change-Id: I7e04e1a9e357ccd0b39b4edcc4c8a34b54e388ce
CRs-Fixed: 2174532
| -rw-r--r-- | core/sap/src/sap_api_link_cntl.c | 8 | ||||
| -rw-r--r-- | core/sap/src/sap_fsm.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 8ee0432c3c4c..a26567362648 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -1004,7 +1004,13 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId, FL("Ignore the Radar indication")); break; } - + if (sap_ctx->sapsMachine != eSAP_STARTED && + sap_ctx->sapsMachine != eSAP_DFS_CAC_WAIT) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, + FL("Ignore Radar event in sap state %d"), + sap_ctx->sapsMachine); + break; + } if (sap_ctx->is_pre_cac_on) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED, FL("sapdfs: Radar detect on pre cac:%d"), diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index b631235d5c9e..da4ed69d8dd8 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -1285,6 +1285,8 @@ static bool sap_is_valid_acs_channel(ptSapContext sap_ctx, uint8_t channel) int i = 0; /* Check whether acs is enabled */ + if (!sap_ctx->acs_cfg) + return true; if (!sap_ctx->acs_cfg->acs_mode) return true; |
