u8 pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id);
 
        skb_cb = ATH12K_SKB_CB(msdu);
+       ar = ab->pdevs[pdev_id].ar;
 
        dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
        if (skb_cb->paddr_ext_desc)
                dma_unmap_single(ab->dev, skb_cb->paddr_ext_desc,
                                 sizeof(struct hal_tx_msdu_ext_desc), DMA_TO_DEVICE);
 
-       dev_kfree_skb_any(msdu);
+       ieee80211_free_txskb(ar->ah->hw, msdu);
 
-       ar = ab->pdevs[pdev_id].ar;
        if (atomic_dec_and_test(&ar->dp.num_tx_pending))
                wake_up(&ar->dp.tx_empty_waitq);
 }
                                       struct hal_tx_status *ts)
 {
        struct ath12k_base *ab = ar->ab;
+       struct ath12k_hw *ah = ar->ah;
        struct ieee80211_tx_info *info;
        struct ath12k_skb_cb *skb_cb;
 
        rcu_read_lock();
 
        if (!rcu_dereference(ab->pdevs_active[ar->pdev_idx])) {
-               dev_kfree_skb_any(msdu);
+               ieee80211_free_txskb(ah->hw, msdu);
                goto exit;
        }
 
        if (!skb_cb->vif) {
-               dev_kfree_skb_any(msdu);
+               ieee80211_free_txskb(ah->hw, msdu);
                goto exit;
        }