diff options
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/dma.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/dma.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/dma.c b/drivers/net/wireless/brcm80211/brcmsmac/dma.c index 1860c572b3c4..4fb9635d3919 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/dma.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.c | |||
@@ -1015,9 +1015,10 @@ static bool dma64_txidle(struct dma_info *di) | |||
1015 | 1015 | ||
1016 | /* | 1016 | /* |
1017 | * post receive buffers | 1017 | * post receive buffers |
1018 | * return false is refill failed completely and ring is empty this will stall | 1018 | * Return false if refill failed completely or dma mapping failed. The ring |
1019 | * the rx dma and user might want to call rxfill again asap. This unlikely | 1019 | * is empty, which will stall the rx dma and user might want to call rxfill |
1020 | * happens on memory-rich NIC, but often on memory-constrained dongle | 1020 | * again asap. This is unlikely to happen on a memory-rich NIC, but often on |
1021 | * memory-constrained dongle. | ||
1021 | */ | 1022 | */ |
1022 | bool dma_rxfill(struct dma_pub *pub) | 1023 | bool dma_rxfill(struct dma_pub *pub) |
1023 | { | 1024 | { |
@@ -1078,6 +1079,8 @@ bool dma_rxfill(struct dma_pub *pub) | |||
1078 | 1079 | ||
1079 | pa = dma_map_single(di->dmadev, p->data, di->rxbufsize, | 1080 | pa = dma_map_single(di->dmadev, p->data, di->rxbufsize, |
1080 | DMA_FROM_DEVICE); | 1081 | DMA_FROM_DEVICE); |
1082 | if (dma_mapping_error(di->dmadev, pa)) | ||
1083 | return false; | ||
1081 | 1084 | ||
1082 | /* save the free packet pointer */ | 1085 | /* save the free packet pointer */ |
1083 | di->rxp[rxout] = p; | 1086 | di->rxp[rxout] = p; |
@@ -1284,7 +1287,11 @@ static void dma_txenq(struct dma_info *di, struct sk_buff *p) | |||
1284 | 1287 | ||
1285 | /* get physical address of buffer start */ | 1288 | /* get physical address of buffer start */ |
1286 | pa = dma_map_single(di->dmadev, data, len, DMA_TO_DEVICE); | 1289 | pa = dma_map_single(di->dmadev, data, len, DMA_TO_DEVICE); |
1287 | 1290 | /* if mapping failed, free skb */ | |
1291 | if (dma_mapping_error(di->dmadev, pa)) { | ||
1292 | brcmu_pkt_buf_free_skb(p); | ||
1293 | return; | ||
1294 | } | ||
1288 | /* With a DMA segment list, Descriptor table is filled | 1295 | /* With a DMA segment list, Descriptor table is filled |
1289 | * using the segment list instead of looping over | 1296 | * using the segment list instead of looping over |
1290 | * buffers in multi-chain DMA. Therefore, EOF for SGLIST | 1297 | * buffers in multi-chain DMA. Therefore, EOF for SGLIST |