summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/dma.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2022-03-19 21:56:20 +0100
committerFelix Fietkau <nbd@nbd.name>2022-05-13 09:39:34 +0200
commit402e01092e79583923579662f244bc538f466f36 (patch)
tree930ade8de46636f2ad8f52abe1c0d896295673a2 /drivers/net/wireless/mediatek/mt76/dma.c
parent9912a4639d1a0b7f2a7df269bf07069590b98444 (diff)
downloadlinux-402e01092e79583923579662f244bc538f466f36.tar.gz
mt76: dma: use kzalloc instead of devm_kzalloc for txwi
dma unmap is already needed for cleanup anyway, so we don't need the extra tracking and can save a bit of memory here Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/dma.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/dma.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
index 02daeefb0761..09dc37bbf112 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/dma.c
@@ -16,7 +16,7 @@ mt76_alloc_txwi(struct mt76_dev *dev)
int size;
size = L1_CACHE_ALIGN(dev->drv->txwi_size + sizeof(*t));
- txwi = devm_kzalloc(dev->dev, size, GFP_ATOMIC);
+ txwi = kzalloc(size, GFP_ATOMIC);
if (!txwi)
return NULL;
@@ -73,9 +73,11 @@ mt76_free_pending_txwi(struct mt76_dev *dev)
struct mt76_txwi_cache *t;
local_bh_disable();
- while ((t = __mt76_get_txwi(dev)) != NULL)
+ while ((t = __mt76_get_txwi(dev)) != NULL) {
dma_unmap_single(dev->dev, t->dma_addr, dev->drv->txwi_size,
DMA_TO_DEVICE);
+ kfree(mt76_get_txwi_ptr(dev, t));
+ }
local_bh_enable();
}