qcacld-3.0: Add pointer sanity check for wma layer APIs

Add some pointer sanity check before use for wma layer APIs.

Change-Id: I9712864b58731d8e8a8908ada359a907ed4fed5b
CRs-Fixed: 2642567
This commit is contained in:
Qun Zhang
2020-03-19 15:16:57 +08:00
committed by nshrivas
szülő 3a8d34c8cb
commit 278c3b465e
3 fájl változott, egészen pontosan 13 új sor hozzáadva és 2 régi sor törölve

Fájl megtekintése

@@ -5388,8 +5388,10 @@ void wma_update_set_key(uint8_t session_id, bool pairwise,
return; return;
} }
iface = &wma->interfaces[session_id]; iface = &wma->interfaces[session_id];
if (!iface) if (!iface) {
wma_info("iface not found for session id %d", session_id); wma_err("iface not found for session id %d", session_id);
return;
}
if (cipher_type == WLAN_CRYPTO_CIPHER_AES_GMAC || if (cipher_type == WLAN_CRYPTO_CIPHER_AES_GMAC ||
cipher_type == WLAN_CRYPTO_CIPHER_AES_GMAC_256 || cipher_type == WLAN_CRYPTO_CIPHER_AES_GMAC_256 ||

Fájl megtekintése

@@ -7600,6 +7600,11 @@ static void wma_set_arp_req_stats(WMA_HANDLE handle,
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma_handle->psoc, vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma_handle->psoc,
req_buf->vdev_id, req_buf->vdev_id,
WLAN_LEGACY_WMA_ID); WLAN_LEGACY_WMA_ID);
if (!vdev) {
WMA_LOGE("Can't get vdev by vdev_id:%d", req_buf->vdev_id);
return;
}
if (!wma_is_vdev_started(vdev)) { if (!wma_is_vdev_started(vdev)) {
WMA_LOGD("vdev id:%d is not started", req_buf->vdev_id); WMA_LOGD("vdev id:%d is not started", req_buf->vdev_id);
goto release_ref; goto release_ref;

Fájl megtekintése

@@ -2387,6 +2387,10 @@ QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id)
iface = &wma->interfaces[vdev_id]; iface = &wma->interfaces[vdev_id];
vdev = iface->vdev; vdev = iface->vdev;
mlme_obj = wlan_vdev_mlme_get_cmpt_obj(vdev); mlme_obj = wlan_vdev_mlme_get_cmpt_obj(vdev);
if (!mlme_obj) {
WMA_LOGE(FL("failed to get mlme_obj"));
return QDF_STATUS_E_INVAL;
}
mlme_obj->proto.sta.assoc_id = 0; mlme_obj->proto.sta.assoc_id = 0;
status = vdev_mgr_up_send(mlme_obj); status = vdev_mgr_up_send(mlme_obj);