summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wcn36xx/dxe.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2018-04-03 18:51:52 +0200
committerKalle Valo <kvalo@codeaurora.org>2018-04-10 17:34:08 +0300
commit7cae35199bee1cd661926f2d68ac46d07682fc54 (patch)
tree6494aa5fcfc9968521a5d6d25c7c98116fc8a850 /drivers/net/wireless/ath/wcn36xx/dxe.c
parent9c27489a34548913baaaf3b2776e05d4a9389e3e (diff)
downloadblackbird-op-linux-7cae35199bee1cd661926f2d68ac46d07682fc54.tar.gz
blackbird-op-linux-7cae35199bee1cd661926f2d68ac46d07682fc54.zip
wcn36xx: check for DMA mapping errors in wcn36xx_dxe_tx_frame()
Bail out if the mapping fails. Even though this hasn't occured during tests, this unlikely case should still be handled. Signed-off-by: Daniel Mack <daniel@zonque.org> Acked-by: Ramon Fried <rfried@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wcn36xx/dxe.c')
-rw-r--r--drivers/net/wireless/ath/wcn36xx/dxe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c
index 2c3b899a88fa..405d350f8708 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.c
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.c
@@ -705,6 +705,11 @@ int wcn36xx_dxe_tx_frame(struct wcn36xx *wcn,
ctl->skb->data,
ctl->skb->len,
DMA_TO_DEVICE);
+ if (dma_mapping_error(wcn->dev, desc->src_addr_l)) {
+ dev_err(wcn->dev, "unable to DMA map src_addr_l\n");
+ ret = -ENOMEM;
+ goto unlock;
+ }
desc->dst_addr_l = ch->dxe_wq;
desc->fr_len = ctl->skb->len;
OpenPOWER on IntegriCloud