mt76: dma: reset q->rx_head on rx reset
authorFelix Fietkau <nbd@nbd.name>
Mon, 12 Aug 2019 13:50:59 +0000 (15:50 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 5 Sep 2019 15:42:32 +0000 (17:42 +0200)
Fixes rx of the first frame if a fragmented rx was interrupted by the reset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/dma.c

index 46f5223b4d8964d48d90612b1331818832f7b2e0..c747eb24581c42683f93f6e285a660e2edd9daea 100644 (file)
@@ -431,6 +431,12 @@ mt76_dma_rx_reset(struct mt76_dev *dev, enum mt76_rxq_id qid)
        mt76_dma_rx_cleanup(dev, q);
        mt76_dma_sync_idx(dev, q);
        mt76_dma_rx_fill(dev, q);
+
+       if (!q->rx_head)
+               return;
+
+       dev_kfree_skb(q->rx_head);
+       q->rx_head = NULL;
 }
 
 static void