From: Daniel Mack <daniel@zonque.org>
To: linux-wireless@vger.kernel.org
Cc: wcn36xx@lists.infradead.org, kvalo@codeaurora.org,
loic.poulain@linaro.org, rfried@codeaurora.org,
bjorn.andersson@linaro.org, Daniel Mack <daniel@zonque.org>
Subject: [PATCH 1/3] wcn36xx: check for DMA mapping errors in wcn36xx_dxe_tx_frame()
Date: Tue, 3 Apr 2018 18:51:52 +0200 [thread overview]
Message-ID: <20180403165154.18775-1-daniel@zonque.org> (raw)
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>
---
drivers/net/wireless/ath/wcn36xx/dxe.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c
index 6e9a3583c447..e8ad8f989ccd 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.c
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.c
@@ -707,6 +707,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;
--
2.14.3
next reply other threads:[~2018-04-03 16:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-03 16:51 Daniel Mack [this message]
2018-04-03 16:51 ` [PATCH 2/3] wcn36xx: don't keep reference to skb if transmission failed Daniel Mack
2018-04-03 16:51 ` [PATCH 3/3] wcn36xx: don't delete invalid bss indices Daniel Mack
2018-04-04 5:40 ` Ramon Fried
2018-04-04 6:39 ` Daniel Mack
2018-04-04 5:37 ` [PATCH 1/3] wcn36xx: check for DMA mapping errors in wcn36xx_dxe_tx_frame() Ramon Fried
2018-04-10 14:38 ` [1/3] " Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180403165154.18775-1-daniel@zonque.org \
--to=daniel@zonque.org \
--cc=bjorn.andersson@linaro.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=rfried@codeaurora.org \
--cc=wcn36xx@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).