mt76: mt7615: fix tx skb dma unmap
authorFelix Fietkau <nbd@nbd.name>
Sat, 13 Feb 2021 17:42:15 +0000 (18:42 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sun, 11 Apr 2021 16:50:38 +0000 (18:50 +0200)
The first pointer in the txp needs to be unmapped as well, otherwise it will
leak DMA mapping entries

Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mac.c

index c97ec70772f396efa9196395fba01dfec89113c0..9bae2f66e1cec3b83f05855bf3ca711ce39bac88 100644 (file)
@@ -690,7 +690,7 @@ mt7615_txp_skb_unmap_fw(struct mt76_dev *dev, struct mt7615_fw_txp *txp)
 {
        int i;
 
-       for (i = 1; i < txp->nbuf; i++)
+       for (i = 0; i < txp->nbuf; i++)
                dma_unmap_single(dev->dev, le32_to_cpu(txp->buf[i]),
                                 le16_to_cpu(txp->len[i]), DMA_TO_DEVICE);
 }