From 1ba55bfa9b06cac12aa5903f6269c871882c8b2d Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Mon, 3 Jun 2019 14:18:40 -0700 Subject: [PATCH] qcacld-3.0: Fix possible NULL pointer dereference Validate the CSR session before accessing it as the session can be NULL for invalid session id. Change-Id: I090d75a44bb9e78cbf7f10ac08ccad9f664e6e06 CRs-Fixed: 2462598 --- core/sme/src/common/sme_api.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index febcaffab5b5..5beb9cc9a289 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -11290,6 +11290,10 @@ void sme_update_he_cap_nss(mac_handle_t mac_handle, uint8_t session_id, sme_err("invalid Nss value %d", nss); } csr_session = CSR_GET_SESSION(mac_ctx, session_id); + if (!csr_session) { + sme_err("No session for id %d", session_id); + return; + } rx_mcs_map = mac_ctx->mlme_cfg->he_caps.dot11_he_cap.rx_he_mcs_map_lt_80; tx_mcs_map =