]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: brcmsmac: Fix dma_free_coherent() size
authorThomas Fourier <fourier.thomas@gmail.com>
Wed, 18 Feb 2026 13:07:37 +0000 (14:07 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 7 Apr 2026 10:34:03 +0000 (12:34 +0200)
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: <stable@vger.kernel.org>
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20260218130741.46566-3-fourier.thomas@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c

index 9f6ef7ce1b582de1974e8ea1bcbc8fcc1627aa70..a329c20e92fbcf1e9bf2d1006fb656157895d8a8 100644 (file)
@@ -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);
        }