mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
wifi: mt76: add DMA mapping error check in mt76_alloc_txwi()
Add 'dma_mapping_error()' check in 'mt76_alloc_txwi()'. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
832f426997
commit
5d0e7dde4a
|
|
@ -53,6 +53,11 @@ mt76_alloc_txwi(struct mt76_dev *dev)
|
|||
|
||||
addr = dma_map_single(dev->dma_dev, txwi, dev->drv->txwi_size,
|
||||
DMA_TO_DEVICE);
|
||||
if (unlikely(dma_mapping_error(dev->dma_dev, addr))) {
|
||||
kfree(txwi);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
t = (struct mt76_txwi_cache *)(txwi + dev->drv->txwi_size);
|
||||
t->dma_addr = addr;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user