Prechádzať zdrojové kódy

qcacld-3.0: Fix null pointer dereference in wma_pdev_div_info_evt_handler

pmac->sme.get_chain_rssi_cb is never checked if
WMI_PDEV_DIV_RSSI_ANTID_EVENTID messages is sent anytime
by user.

pmac->sme.get_chain_rssi_cb can not be appropriately
registered and can result in NULL pointer dereference.

Change-Id: I64783a0e2d054b45678f126b42de20470d3264d3
CRs-Fixed: 2324128
Harprit Chhabada 6 rokov pred
rodič
commit
2e2aa6962c
1 zmenil súbory, kde vykonal 4 pridanie a 0 odobranie
  1. 4 0
      core/wma/src/wma_features.c

+ 4 - 0
core/wma/src/wma_features.c

@@ -5806,6 +5806,10 @@ int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
 		return -EINVAL;
 	}
 
+	if (!pmac->sme.get_chain_rssi_cb) {
+		WMA_LOGE(FL("Invalid get_chain_rssi_cb"));
+		return -EINVAL;
+	}
 	param_buf = (WMI_PDEV_DIV_RSSI_ANTID_EVENTID_param_tlvs *) event_buf;
 	if (!param_buf) {
 		WMA_LOGE(FL("Invalid rssi antid event buffer"));