* [PATCH net-next] wifi: qtnfmac: topaz: Fix dma_unmap_single() size
@ 2026-10-16 13:45 Thomas Fourier
0 siblings, 0 replies; only message in thread
From: Thomas Fourier @ 2026-10-16 13:45 UTC (permalink / raw)
Cc: Thomas Fourier, Igor Mitsyanko, Sergey Matyukevich, Runyu Xiao,
Kalle Valo, Andrey Shevchenko,
open list:QUANTENNA QTNFMAC WIRELESS DRIVER, open list
In qtnf_pcie_data_tx(), the SKB is mapped with size skb->len, but it is
unmapped in qtnf_topaz_free_xfer_buffers() with size SKB_BUF_SIZE. This
could leave parts of the buffer mapped, and thus leave memory exposed
to the device.
Change the size of the unmap to skb->len.
This bug was statically found and compile-tested only.
Fixes: e401fa25cfa2 ("qtnfmac: add support for Topaz chipsets")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
index a3a285f17dca..2e00bf68d001 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
@@ -322,7 +322,7 @@ static void qtnf_topaz_free_xfer_buffers(struct qtnf_pcie_topaz_state *ts)
skb = priv->tx_skb[i];
paddr = QTN_HOST_ADDR(0x0, le32_to_cpu(txbd->addr));
dma_unmap_single(&priv->pdev->dev, paddr,
- SKB_BUF_SIZE, DMA_TO_DEVICE);
+ skb->len, DMA_TO_DEVICE);
dev_kfree_skb_any(skb);
priv->tx_skb[i] = NULL;
txbd->addr = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-16 13:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 13:45 [PATCH net-next] wifi: qtnfmac: topaz: Fix dma_unmap_single() size Thomas Fourier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox