]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
mt76: mt7915: fix tx skb dma unmap
authorFelix Fietkau <nbd@nbd.name>
Sat, 13 Feb 2021 17:44:10 +0000 (18:44 +0100)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:36 +0000 (17:46 -0600)
BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 7dcf3c04f0aca746517a77433b33d40868ca4749 ]

The first pointer in the txp needs to be unmapped as well, otherwise it will
leak DMA mapping entries

Reported-by: Ben Greear <greearb@candelatech.com>
Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/wireless/mediatek/mt76/mt7915/mac.c

index c9dd6867e1251fd81bb42787f427df48638e7626..8a083304ab031558d1926e69b497aebf6cf345a5 100644 (file)
@@ -1082,7 +1082,7 @@ void mt7915_txp_skb_unmap(struct mt76_dev *dev,
        int i;
 
        txp = mt7915_txwi_to_txp(dev, t);
-       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);
 }