qcacld-3.0: Validate mac_ctx before using it

Validate mac_ctx before dereferencing it.

Change-Id: Iba786647c5a54e0a67ff7b9cbb0dbaea3bd52d76
CRs-Fixed: 2699734
This commit is contained in:
Gururaj Pandurangi 2020-06-01 18:15:34 -07:00 • committed by nshrivas
commit 7fe6ad582f

View file

@ -1658,13 +1658,19 @@ lim_process_mlm_del_all_sta_rsp(struct vdev_mlme_obj *vdev_mlme,
{
struct pe_session *session_entry;
tSirResultCodes status_code = eSIR_SME_SUCCESS;
struct mac_context *mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
struct mac_context *mac_ctx;
struct wlan_objmgr_vdev *vdev;
uint8_t vdev_id;
vdev = vdev_mlme->vdev;
vdev_id = wlan_vdev_get_id(vdev);
mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
if (!mac_ctx) {
pe_err("mac_ctx is NULL");
return QDF_STATUS_E_INVAL;
}
SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true);
session_entry = pe_find_session_by_vdev_id(mac_ctx,