]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath11k: fix warning when unbinding
authorJose Ignacio Tornos Martinez <jtornosm@redhat.com>
Mon, 20 Apr 2026 11:01:29 +0000 (13:01 +0200)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Wed, 20 May 2026 16:57:20 +0000 (09:57 -0700)
If there is an error during some initialization related to firmware,
the buffers dp->tx_ring[i].tx_status are released.
However this is released again when the device is unbinded (ath11k_pci),
and we get:
WARNING: CPU: 0 PID: 6231 at mm/slub.c:4368 free_large_kmalloc+0x57/0x90
Call Trace:
free_large_kmalloc
ath11k_dp_free
ath11k_core_deinit
ath11k_pci_remove
...

The issue is always reproducible from a VM because the MSI addressing
initialization is failing.

In order to fix the issue, just set the buffers to NULL after releasing in
order to avoid the double free.

Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Cc: stable@vger.kernel.org
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260420110130.509670-1-jtornosm@redhat.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath11k/dp.c

index bbb86f1651419939a8d9352d594e0c339a9738b1..5a50b623bd07b9ffb84b7ff636e8517df1cae053 100644 (file)
@@ -1040,6 +1040,7 @@ void ath11k_dp_free(struct ath11k_base *ab)
                idr_destroy(&dp->tx_ring[i].txbuf_idr);
                spin_unlock_bh(&dp->tx_ring[i].tx_idr_lock);
                kfree(dp->tx_ring[i].tx_status);
+               dp->tx_ring[i].tx_status = NULL;
        }
 
        /* Deinit any SOC level resource */