mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
mwl8k: Add missing check after DMA map
The DMA map functions can fail and should be tested for errors.
If the mapping fails, unmap and return an error.
Fixes: 788838ebe8 ("mwl8k: use pci_unmap_addr{,set}() to keep track of unmap addresses on rx")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Link: https://patch.msgid.link/20250709111339.25360-2-fourier.thomas@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
1772e571b3
commit
50459501b9
|
|
@ -1227,6 +1227,10 @@ static int rxq_refill(struct ieee80211_hw *hw, int index, int limit)
|
|||
|
||||
addr = dma_map_single(&priv->pdev->dev, skb->data,
|
||||
MWL8K_RX_MAXSZ, DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(&priv->pdev->dev, addr)) {
|
||||
kfree_skb(skb);
|
||||
break;
|
||||
}
|
||||
|
||||
rxq->rxd_count++;
|
||||
rx = rxq->tail++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user