qcacld-3.0: Fix NULL pointer dereference issue

In cm_is_peer_preset_on_other_sta, wma_context is
fetched from gp_cds_context and used without any
validation checks. This may lead in NULL pointer
dereference.

To address this issue add null check before
accessing.

Change-Id: I78656303855efb2369afcf47d1aabe3b916498c4
CRs-Fixed: 3712317
This commit is contained in:
Asutosh Mohapatra
2024-01-22 16:58:46 +05:30
committed by Ravindra Konda
parent 0545a12a42
commit 3d820ee297

View File

@@ -70,6 +70,11 @@ cm_is_peer_preset_on_other_sta(struct wlan_objmgr_psoc *psoc,
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
uint8_t peer_vdev_id;
if (!wma) {
wma_err("wma_handle is NULL");
return false;
}
sync_ind = (struct roam_offload_synch_ind *)event;
if (wma_objmgr_peer_exist(wma, sync_ind->bssid.bytes, &peer_vdev_id)) {