Commit bb97131f authored by Thomas Fourier's avatar Thomas Fourier Committed by Jeff Johnson
Browse files

wifi: ath12k: fix dma_free_coherent() pointer



dma_alloc_coherent() allocates a DMA mapped buffer and stores the
addresses in XXX_unaligned fields.  Those should be reused when freeing
the buffer rather than the aligned addresses.

Fixes: d8899132 ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarThomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: default avatarBaochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260106084905.18622-2-fourier.thomas@gmail.com


Signed-off-by: default avatarJeff Johnson <jeff.johnson@oss.qualcomm.com>
parent 9282a1e1
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -984,8 +984,8 @@ void ath12k_ce_free_pipes(struct ath12k_base *ab)
			dma_free_coherent(ab->dev,
					  pipe->src_ring->nentries * desc_sz +
					  CE_DESC_RING_ALIGN,
					  pipe->src_ring->base_addr_owner_space,
					  pipe->src_ring->base_addr_ce_space);
					  pipe->src_ring->base_addr_owner_space_unaligned,
					  pipe->src_ring->base_addr_ce_space_unaligned);
			kfree(pipe->src_ring);
			pipe->src_ring = NULL;
		}
@@ -995,8 +995,8 @@ void ath12k_ce_free_pipes(struct ath12k_base *ab)
			dma_free_coherent(ab->dev,
					  pipe->dest_ring->nentries * desc_sz +
					  CE_DESC_RING_ALIGN,
					  pipe->dest_ring->base_addr_owner_space,
					  pipe->dest_ring->base_addr_ce_space);
					  pipe->dest_ring->base_addr_owner_space_unaligned,
					  pipe->dest_ring->base_addr_ce_space_unaligned);
			kfree(pipe->dest_ring);
			pipe->dest_ring = NULL;
		}
@@ -1007,8 +1007,8 @@ void ath12k_ce_free_pipes(struct ath12k_base *ab)
			dma_free_coherent(ab->dev,
					  pipe->status_ring->nentries * desc_sz +
					  CE_DESC_RING_ALIGN,
					  pipe->status_ring->base_addr_owner_space,
					  pipe->status_ring->base_addr_ce_space);
					  pipe->status_ring->base_addr_owner_space_unaligned,
					  pipe->status_ring->base_addr_ce_space_unaligned);
			kfree(pipe->status_ring);
			pipe->status_ring = NULL;
		}