Skip to content

Commit ca68ce0

Browse files
jtornosmJeff Johnson
authored andcommitted
wifi: ath12k: fix warning when unbinding
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 (ath12k_pci), and we get: WARNING: CPU: 0 PID: 2098 at mm/slub.c:4689 free_large_kmalloc+0x4d/0x80 Call Trace: free_large_kmalloc ath12k_dp_free ath12k_core_deinit ath12k_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. cc: stable@vger.kernel.org Fixes: d889913 ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com> Link: https://patch.msgid.link/20241017181004.199589-3-jtornosm@redhat.com Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
1 parent 1304446 commit ca68ce0

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/wireless/ath/ath12k

1 file changed

+3
-1
lines changed

drivers/net/wireless/ath/ath12k/dp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,8 +1286,10 @@ void ath12k_dp_free(struct ath12k_base *ab)
12861286

12871287
ath12k_dp_rx_reo_cmd_list_cleanup(ab);
12881288

1289-
for (i = 0; i < ab->hw_params->max_tx_ring; i++)
1289+
for (i = 0; i < ab->hw_params->max_tx_ring; i++) {
12901290
kfree(dp->tx_ring[i].tx_status);
1291+
dp->tx_ring[i].tx_status = NULL;
1292+
}
12911293

12921294
ath12k_dp_rx_free(ab);
12931295
/* Deinit any SOC level resource */

0 commit comments

Comments
 (0)