mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
dma: fix rx dma unmap length
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -169,7 +169,6 @@ mt76_dma_rx_fill(struct mt76_dev *dev, struct mt76_queue *q)
|
||||
break;
|
||||
|
||||
addr = dma_map_single(dev->dev, buf, len, DMA_FROM_DEVICE);
|
||||
|
||||
if (dma_mapping_error(dev->dev, addr)) {
|
||||
kfree(buf);
|
||||
break;
|
||||
@@ -360,6 +359,7 @@ mt76_rx_get_buf(struct mt76_dev *dev, struct mt76_queue *q, int idx, int *len)
|
||||
struct mt76_queue_entry *e;
|
||||
dma_addr_t buf_addr;
|
||||
void *buf;
|
||||
int buf_len = SKB_WITH_OVERHEAD(q->buf_size);
|
||||
|
||||
e = &q->entry[idx];
|
||||
buf = e->buf;
|
||||
@@ -368,7 +368,7 @@ mt76_rx_get_buf(struct mt76_dev *dev, struct mt76_queue *q, int idx, int *len)
|
||||
u32 ctl = ACCESS_ONCE(q->desc[idx].ctrl);
|
||||
*len = MT76_GET(MT_DMA_CTL_SD_LEN0, ctl);
|
||||
}
|
||||
dma_unmap_single(dev->dev, buf_addr, q->buf_size, DMA_FROM_DEVICE);
|
||||
dma_unmap_single(dev->dev, buf_addr, buf_len, DMA_FROM_DEVICE);
|
||||
e->buf = NULL;
|
||||
|
||||
return buf;
|
||||
|
||||
Reference in New Issue
Block a user