Patch "wifi: brcmfmac: unmap dma buffer in brcmf_msgbuf_alloc_pktid()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: brcmfmac: unmap dma buffer in brcmf_msgbuf_alloc_pktid()

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-brcmfmac-unmap-dma-buffer-in-brcmf_msgbuf_alloc.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 48783fd3bd258d48c2cb4e55900550d76d620c69
Author: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
Date:   Wed Dec 7 09:31:14 2022 +0800

    wifi: brcmfmac: unmap dma buffer in brcmf_msgbuf_alloc_pktid()
    
    [ Upstream commit b9f420032f2ba1e634b22ca7b433e5c40ea663af ]
    
    After the DMA buffer is mapped to a physical address, address is stored
    in pktids in brcmf_msgbuf_alloc_pktid(). Then, pktids is parsed in
    brcmf_msgbuf_get_pktid()/brcmf_msgbuf_release_array() to obtain physaddr
    and later unmap the DMA buffer. But when count is always equal to
    pktids->array_size, physaddr isn't stored in pktids and the DMA buffer
    will not be unmapped anyway.
    
    Fixes: 9a1bb60250d2 ("brcmfmac: Adding msgbuf protocol.")
    Signed-off-by: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
    Reviewed-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221207013114.1748936-1-shaozhengchao@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
index 768a99c15c08b..e81e892ddacc5 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
@@ -339,8 +339,11 @@ brcmf_msgbuf_alloc_pktid(struct device *dev,
 		count++;
 	} while (count < pktids->array_size);
 
-	if (count == pktids->array_size)
+	if (count == pktids->array_size) {
+		dma_unmap_single(dev, *physaddr, skb->len - data_offset,
+				 pktids->direction);
 		return -ENOMEM;
+	}
 
 	array[*idx].data_offset = data_offset;
 	array[*idx].physaddr = *physaddr;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux