Ver código fonte

qcacld-3.0: Add sanity check for RRM global channel list

Add sanity check for RRM global channel list to avoid
possible NULL-Pointer issue.

Change-Id: Icfbf5282304a549a0dc92889f83cb1a31dde15b2
CRs-Fixed: 2972194
Yu Wang 3 anos atrás
pai
commit
df4bcbdb97
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      core/sme/src/rrm/sme_rrm.c

+ 7 - 0
core/sme/src/rrm/sme_rrm.c

@@ -799,6 +799,13 @@ QDF_STATUS sme_rrm_issue_scan_req(struct mac_context *mac_ctx, uint8_t idx)
 		uint16_t i;
 		char *chan_buff = NULL;
 
+		if (!sme_rrm_ctx->channelList.numOfChannels ||
+		    !sme_rrm_ctx->channelList.freq_list) {
+			sme_err("[802.11 RRM]: Global freq list is null");
+			status = QDF_STATUS_E_FAILURE;
+			goto send_ind;
+		}
+
 		req = qdf_mem_malloc(sizeof(*req));
 		if (!req) {
 			status = QDF_STATUS_E_NOMEM;