1
0

qcacld-3.0: Validate mac context in CSA bw selection API

Add sanity check mac context before using it in API
wlansap_get_csa_chanwidth_from_phymode.

Change-Id: I8df501e850b606615c899321fc23636ad985ab23
CRs-Fixed: 2955278
Este cometimento está contido em:
Liangwei Dong
2021-05-28 17:22:18 +08:00
cometido por Madan Koyyalamudi
ascendente 8e73a4a3b5
cometimento 41b381e1f9

Ver ficheiro

@@ -1253,9 +1253,15 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context,
{
uint32_t max_fw_bw;
enum phy_ch_width ch_width, concurrent_bw = 0;
struct mac_context *mac = sap_get_mac_context();
struct mac_context *mac;
struct ch_params ch_params = {0};
mac = sap_get_mac_context();
if (!mac) {
sap_err("Invalid MAC context");
return CH_WIDTH_20MHZ;
}
if (WLAN_REG_IS_24GHZ_CH_FREQ(chan_freq)) {
/*
* currently OBSS scan is done in hostapd, so to avoid