wifi: brcmsmac: Fix dma_free_coherent() size
Subsystems (2)
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")
Cc <[email protected]>
Signed-off-by Thomas Fourier <[email protected]>
--- 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
@@ -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
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")Cc <[email protected]>
Looks good to me.
Acked-by Arend van Spriel <[email protected]>
Quoted 4 lines
Signed-off-by Thomas Fourier <[email protected]>--- drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)