[PATCH 1/5] wifi: ath11k: refactor transmitted arvif retrieval
Aloka Dixit
quic_alokad at quicinc.com
Fri Jan 17 16:36:07 PST 2025
On 1/15/2025 11:36 AM, Sidhanta Sahu wrote:
>
>> +static struct ath11k_vif *ath11k_mac_get_tx_arvif(struct
>> ath11k_vif *arvif)
>> +{
>> + if (arvif->vif->mbssid_tx_vif)
>> + return ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif);
>> +
>> + return NULL;
>> +}
>> +
>> static int ath11k_mac_setup_bcn_tmpl_ema(struct ath11k_vif *arvif)
>> {
>> struct ath11k_vif *tx_arvif;
>> @@ -1538,7 +1546,7 @@ static int ath11k_mac_setup_bcn_tmpl_ema(struct
>> ath11k_vif *arvif)
>> u32 params = 0;
>> u8 i = 0;
>> - tx_arvif = ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif);
>> + tx_arvif = ath11k_mac_get_tx_arvif(arvif);
>
> ath11k_mac_get_tx_arvif can return NULL, below, we are accessing
> tx_arvif without a NULL check. Shouldn't we add a null check wherever
> applicable to prevent potential issues?
>
>> beacons =
>> ieee80211_beacon_get_template_ema_list(tx_arvif->ar->hw,
>> tx_arvif->vif, 0);
ath11k_mac_setup_bcn_tmpl_ema() gets called only when tx_arvif is non-NULL.
More information about the ath11k
mailing list