Prechádzať zdrojové kódy

qcacld-3.0: Add sanity check to validate vdev_id

Add a sanity check for validating vdev_id in the function
sme_set_wlm_latency_level. If Invalid vdev_id is passed down
it might lead to an assert in firmware.

Change-Id: Ie410d2655a607628b0741c9efd1fbfaa00c5dc78
CRs-Fixed: 3599133
Aditya Kodukula 1 rok pred
rodič
commit
d270d9ebc3
1 zmenil súbory, kde vykonal 5 pridanie a 0 odobranie
  1. 5 0
      core/sme/src/common/sme_api.c

+ 5 - 0
core/sme/src/common/sme_api.c

@@ -7330,6 +7330,11 @@ QDF_STATUS sme_set_wlm_latency_level(mac_handle_t mac_handle,
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	if (session_id == WLAN_INVALID_LINK_ID) {
+		sme_err("Invalid vdev_id[%u]", session_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	params.wlm_latency_level = latency_level;
 	params.wlm_latency_flags =
 		mac_ctx->mlme_cfg->wlm_config.latency_flags[latency_level];