Re: [PATCH] wifi: ath11k: fix memory leaks in beacon template setup

Zilin Guan <[email protected]>
Newsgroups org.infradead.lists.ath11k,org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless
Message-ID <[email protected]>
On Tue, Jan 20, 2026 at 10:52:54AM +0800, Baochen Qiang wrote:
> below would be better?
> 
> @@ -1622,19 +1622,21 @@ static int ath11k_mac_setup_bcn_tmpl_mbssid(struct ath11k_vif *arvif,
>         }
> 
>         if (tx_arvif == arvif) {
> -               if (ath11k_mac_set_vif_params(tx_arvif, bcn))
> -                       return -EINVAL;
> +               if (ath11k_mac_set_vif_params(tx_arvif, bcn)) {
> +                       ret = -EINVAL;
> +                       goto free;
> +               }
>         } else if (!ath11k_mac_set_nontx_vif_params(tx_arvif, arvif, bcn)) {
> -               return -EINVAL;
> +               ret = -EINVAL;
> +               goto free;
>         }
> 
>         ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn, 0);
> -       kfree_skb(bcn);
> -
>         if (ret)
>                 ath11k_warn(ab, "failed to submit beacon template command: %d\n",
>                             ret);
> -
> +free:
> +       kfree_skb(bcn);
>         return ret;
>  }
> 
> >  static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)

Thanks for your suggestion. I will send a v2 to change it.

Regards,
Zilin Guan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.