From: Lorenzo Bianconi Date: Sun, 1 Jan 2023 11:50:05 +0000 (+0100) Subject: wifi: mt76: dma: fix memory leak running mt76_dma_tx_cleanup X-Git-Tag: microblaze-v6.6~1120^2~39^2~101^2~43 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=3f7dda36e0b6dfa2cd26191f754ba061ab8191f2;p=linux-2.6-microblaze.git wifi: mt76: dma: fix memory leak running mt76_dma_tx_cleanup Fix device unregister memory leak and alway cleanup all configured rx queues in mt76_dma_tx_cleanup routine. Fixes: 52546e27787e ("wifi: mt76: add WED RX support to dma queue alloc") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau --- diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 805684f249ce..d29cb6cda2a9 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -960,8 +960,7 @@ void mt76_dma_cleanup(struct mt76_dev *dev) struct mt76_queue *q = &dev->q_rx[i]; netif_napi_del(&dev->napi[i]); - if (FIELD_GET(MT_QFLAG_WED_TYPE, q->flags)) - mt76_dma_rx_cleanup(dev, q); + mt76_dma_rx_cleanup(dev, q); } mt76_free_pending_txwi(dev);