diff options
| author | Yingying Tang <yintang@codeaurora.org> | 2016-10-20 17:43:59 +0800 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-12-29 13:23:28 -0800 |
| commit | 7890bbc0665f836a19b038d2534e2ef6fcb79997 (patch) | |
| tree | dce591665f8c7c4c20e90046371dbda64bbdcde3 | |
| parent | 622707bf120388d18348ca6c730511c21b481c22 (diff) | |
qcacld-3.0: Fix incorrect NULL pointer check for SAP
Propagate from qcacld-2.0 to qcacld-3.0
Currently there are some places where array name is compared to NULL
in SAP. Add fix to correct it.
CRs-Fixed: 1063255
Change-Id: I736ac42dd08cd6d3375b7693e914e825dae6c702
| -rw-r--r-- | core/sap/src/sap_ch_select.c | 34 | ||||
| -rw-r--r-- | core/sap/src/sap_module.c | 20 |
2 files changed, 26 insertions, 28 deletions
diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index dfbc660fa07e..77475acaa080 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -1214,22 +1214,24 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, vhtSupport = 0; centerFreq = 0; - if (pScanResult->BssDescriptor.ieFields != NULL) { - ieLen = GET_IE_LEN_IN_BSS( - pScanResult->BssDescriptor.length); - qdf_mem_set((uint8_t *) pBeaconStruct, - sizeof(tSirProbeRespBeacon), 0); - - if ((sir_parse_beacon_ie - (pMac, pBeaconStruct, (uint8_t *) - (pScanResult->BssDescriptor.ieFields), - ieLen)) == eSIR_SUCCESS) { - sap_upd_chan_spec_params(pBeaconStruct, - &channelWidth, &secondaryChannelOffset, - &vhtSupport, ¢erFreq, - ¢erFreq_2); - } - } + + ieLen = GET_IE_LEN_IN_BSS( + pScanResult->BssDescriptor.length); + qdf_mem_set((uint8_t *) pBeaconStruct, + sizeof(tSirProbeRespBeacon), 0); + + + if ((sir_parse_beacon_ie + (pMac, pBeaconStruct, (uint8_t *) + (pScanResult->BssDescriptor.ieFields), + ieLen)) == eSIR_SUCCESS) + sap_upd_chan_spec_params( + pBeaconStruct, + &channelWidth, + &secondaryChannelOffset, + &vhtSupport, ¢erFreq, + ¢erFreq_2); + /* Processing for each tCsrScanResultInfo in the tCsrScanResult DLink list */ for (chn_num = 0; chn_num < pSpectInfoParams->numSpectChans; chn_num++) { diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 9761b72bcc8d..d9a6f1345123 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1192,23 +1192,19 @@ QDF_STATUS wlansap_clear_acl(void *pCtx) return QDF_STATUS_E_RESOURCES; } - if (pSapCtx->denyMacList != NULL) { - for (i = 0; i < (pSapCtx->nDenyMac - 1); i++) { - qdf_mem_zero((pSapCtx->denyMacList + i)->bytes, - QDF_MAC_ADDR_SIZE); - - } + for (i = 0; i < (pSapCtx->nDenyMac - 1); i++) { + qdf_mem_zero((pSapCtx->denyMacList + i)->bytes, + QDF_MAC_ADDR_SIZE); } + sap_print_acl(pSapCtx->denyMacList, pSapCtx->nDenyMac); pSapCtx->nDenyMac = 0; - if (pSapCtx->acceptMacList != NULL) { - for (i = 0; i < (pSapCtx->nAcceptMac - 1); i++) { - qdf_mem_zero((pSapCtx->acceptMacList + i)->bytes, - QDF_MAC_ADDR_SIZE); - - } + for (i = 0; i < (pSapCtx->nAcceptMac - 1); i++) { + qdf_mem_zero((pSapCtx->acceptMacList + i)->bytes, + QDF_MAC_ADDR_SIZE); } + sap_print_acl(pSapCtx->acceptMacList, pSapCtx->nAcceptMac); pSapCtx->nAcceptMac = 0; |
