Browse Source

qcacld-3.0: Fix ie null pointer access in lim_enable_twt()

Check whether ie's is present or not before dereferencing it
in lim_enable_twt().

Change-Id: Ibecb66884f59972b0f3cefc226991f6931f50106
CRs-Fixed: 3221108
Jyoti Kumari 2 years ago
parent
commit
0061692560
1 changed files with 6 additions and 1 deletions
  1. 6 1
      core/mac/src/pe/lim/lim_process_sme_req_messages.c

+ 6 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2653,7 +2653,12 @@ static bool lim_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie)
 	struct s_ext_cap *ext_cap;
 	bool twt_support_in_11n = false;
 
-	if (mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_request && ie &&
+	if (!ie) {
+		pe_debug("ie is null");
+		return false;
+	}
+
+	if (mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_request &&
 	    (ie->qcn_ie.present || ie->he_cap.twt_responder)) {
 		pe_debug("TWT is supported, hence disable UAPSD; twt req supp: %d,twt respon supp: %d, QCN_IE: %d",
 			  mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_request,