Search Linux Wireless

Re: [PATCH 1/5] wifi: ath11k: refactor transmitted arvif retrieval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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.






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux