diff options
| author | Sreelakshmi Konamki <c_skonam@qti.qualcomm.com> | 2016-03-18 18:41:48 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-03-31 15:03:14 +0530 |
| commit | fcb4509b64ee8109ef8189e4d5e1f76dce1408ec (patch) | |
| tree | 374d71adac5bd4fc58a6d885ac9ece40ce8e13ea | |
| parent | 172a110a61c2883ee5e4aa92740646b0d580d5df (diff) | |
qcacld-2.0: Fix suspicious dereference of pointer
Dereference of 'roamSession' pointer before NULL check in
sme_is_sta_smps_allowed().
Fix to move dereference statements after NULL check.
Change-Id: I04d72a4b8fbc4ba68850ae665e2248a386fa4c10
CRs-Fixed: 992082
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 977cfff804b0..a5a56c8eaee3 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -18139,10 +18139,6 @@ bool sme_is_sta_smps_allowed(tHalHandle hal, uint8_t session_id) FL("Failed to get mac_ctx")); return false; } - if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) { - smsLog(mac_ctx, LOGE, "CSR session not valid: %d", session_id); - return false; - } csr_session = CSR_GET_SESSION(mac_ctx, session_id); if (NULL == csr_session) { @@ -18150,6 +18146,11 @@ bool sme_is_sta_smps_allowed(tHalHandle hal, uint8_t session_id) return false; } + if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) { + smsLog(mac_ctx, LOGE, "CSR session not valid: %d", session_id); + return false; + } + return (csr_session->supported_nss_1x1 == true) ? false : true; } |
