Skip to contentSkip to conversation

wifi: brcmsmac: Fix dma_free_coherent() size

PATCH In review Thomas Fourier 2 participants 2 messages Feb 18 – Mar 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: brcmsmac: Fix dma_free_coherent() size

dma_alloc_consistent() may change the size to align it. The new size is saved in alloced.

Change the free size to match the allocation size.

Fixes 5b435de0d786 ("net: wireless: add brcm80211 drivers")
---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c +1 -1
index c739bf7463b3..13d0d6b68238 100644
@@ -483,7 +483,7 @@ static void *dma_ringalloc(struct dma_info *di, u32 boundary, uint size,
 	if (((desc_strtaddr + size - 1) & boundary) != (desc_strtaddr
 							& boundary)) {
 		*alignbits = dma_align_sizetobits(size);
-		dma_free_coherent(di->dmadev, size, va, *descpa);
+		dma_free_coherent(di->dmadev, *alloced, va, *descpa);
 		va = dma_alloc_consistent(di, size, *alignbits,
 			alloced, descpa);
 	}
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Thomas Fourier

dma_alloc_consistent() may change the size to align it. The new size is saved in alloced.

Change the free size to match the allocation size.

Fixes 5b435de0d786 ("net: wireless: add brcm80211 drivers")

Looks good to me.

Quoted 4 lines
---
  drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)