qcacld-3.0: Avoid NULL pointer access

In function wlan_hdd_set_sap_csa_reason, sap_ctx pointer is
dereferenced without NULL check.

Add NULL check to avoid null pointer access.

Change-Id: I74bbfdcae6d5a06d5eaf0cd66e3ff9c3380c6bb0
CRs-Fixed: 2512034
This commit is contained in:
Bala Venkatesh 2019-08-20 15:44:31 +05:30 • committed by nshrivas
commit 42e07eac72

View file

@ -3085,7 +3085,8 @@ void wlan_hdd_set_sap_csa_reason(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
return;
}
sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(ap_adapter);
sap_ctx->csa_reason = reason;
if (sap_ctx)
sap_ctx->csa_reason = reason;
}
QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
@ -3185,7 +3186,8 @@ sap_restart:
hdd_ap_ctx->sap_config.channel, intf_ch);
ch_params.ch_width = CH_WIDTH_MAX;
hdd_ap_ctx->bss_stop_reason = BSS_STOP_DUE_TO_MCC_SCC_SWITCH;
hdd_ap_ctx->sap_context->csa_reason =
if (hdd_ap_ctx->sap_context)
hdd_ap_ctx->sap_context->csa_reason =
CSA_REASON_CONCURRENT_STA_CHANGED_CHANNEL;
wlan_reg_set_channel_params(hdd_ctx->pdev,